 package CurtainDesign;

 import CurtainDesign.utils.CalculateUtils;
 import CurtainDesign.utils.CurtainChecker;
 import CurtainDesign.utils.HingeRelatedInfo;
 import CurtainDesign.utils.JsonUtil;
 import com.lowagie.text.*;
 import com.lowagie.text.pdf.BaseFont;
 import com.lowagie.text.pdf.PdfPCell;
 import com.lowagie.text.pdf.PdfPTable;
 import com.lowagie.text.pdf.PdfWriter;
 import com.sun.image.codec.jpeg.JPEGCodec;
 import com.sun.image.codec.jpeg.JPEGImageEncoder;
 import java.awt.Color;
 import java.awt.Graphics;
 import java.awt.image.BufferedImage;
 import java.io.BufferedOutputStream;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.PrintStream;
 import java.text.DateFormat;
 import java.text.DecimalFormat;
 import java.text.NumberFormat;
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
 import javax.swing.JOptionPane;
 import org.apache.log4j.Logger;

 public class ResultInfoRectSimple extends ResultInfo
		 {
	   private Logger logger = Logger.getLogger(ResultInfoRectSimple.class);

	   private WindowCalResultInfo winCalResult = null;

	   public ResultInfoRectSimple()
	   {
		     this.m_OrderInfo = CurtainDesign.m_UserMainGUI.GetOrderInfo();

		     System.out.println(JsonUtil.toJSON(m_OrderInfo));

		     this.winCalResult = new WindowCalResultInfo();

		     int level = new Integer(this.m_OrderInfo.GetLevel()).intValue();
		     String hingeInstallType = null;
		     int distNum = 0;
		     LevelCalResultInfo topLevelInfo = null;
		     if (level == 1) // 一层的情况
			     {
			     	// 合页安装类型
			       hingeInstallType = this.m_OrderInfo.GetHingeInstallType();
			       String[] distHingeInstallTypes = hingeInstallType.trim().toUpperCase().split("T");
			       distNum = distHingeInstallTypes.length;
			       DistinctCalResultInfo[] distInfos = new DistinctCalResultInfo[distNum];
			       for (int i = 0; i < distNum; i++)
				       {
				         distInfos[i] = new DistinctCalResultInfo();
				         distInfos[i].setHingeInstallType(distHingeInstallTypes[i]);
				       }
			       topLevelInfo = new LevelCalResultInfo(1);
			       topLevelInfo.setDistInfo(distInfos);
			       this.winCalResult.setLeveInfo(new LevelCalResultInfo[] { topLevelInfo });
			     }
		     else if (level == 2) // 两层的情况
			     {
			       hingeInstallType = this.m_OrderInfo.GetHingeInstallType();
			       String[] distHingeInstallTypes = hingeInstallType.trim().toUpperCase().split("T");
			       distNum = distHingeInstallTypes.length;
			       DistinctCalResultInfo[] distInfos = new DistinctCalResultInfo[distNum];
			       for (int i = 0; i < distNum; i++)
				       {
				         distInfos[i] = new DistinctCalResultInfo();
				         distInfos[i].setHingeInstallType(distHingeInstallTypes[i]);
				       }
			       topLevelInfo = new LevelCalResultInfo(1);
			       topLevelInfo.setDistInfo(distInfos);

			       hingeInstallType = this.m_OrderInfo.getBottomHingeInstallType();
			       distHingeInstallTypes = hingeInstallType.trim().toUpperCase().split("T");
			       distNum = distHingeInstallTypes.length;
			       DistinctCalResultInfo[] bottomDistInfos = new DistinctCalResultInfo[distNum];
			       for (int i = 0; i < distNum; i++)
				       {
				         bottomDistInfos[i] = new DistinctCalResultInfo();
				         bottomDistInfos[i].setHingeInstallType(distHingeInstallTypes[i]);
				       }
			       LevelCalResultInfo bottomLevelInfo = new LevelCalResultInfo(2);
			       bottomLevelInfo.setDistInfo(bottomDistInfos);
			       // 处理两层的情况
			       this.winCalResult.setLeveInfo(new LevelCalResultInfo[] { topLevelInfo, bottomLevelInfo });
			     }
		   }

	   public boolean Output(String pathfile)
	   {
		     Output output = new Output();
		     return output.OutputToPdfFile(pathfile);
		   }

	   public void DrawPic() {
		     JeruGraphics m_JeruGraphics = new JeruGraphics();
		     m_JeruGraphics.DrawPic();
		   }

	   public boolean Calculate() {
		     CalculateRectSimple calculate = new CalculateRectSimple();
		     return calculate.exec();
		   }

	   class DistinctCalResultInfo
			   {
		     private float upBeamLength; // 上梁长度
		     private float downBeamLength; // 下梁长度
		     private float vaneLength; // 叶片长度
		     private float dividerLength; // 分隔梁长度
		     private String hingeInstallType = null; // 合页安装类型
		     private float bordLength;
		     private float bordWidth;
		     private int distPaneNum; // todo

		     DistinctCalResultInfo()
		     {
			     }

		     public float getDownBeamLength()
		     {
			       return this.downBeamLength;
			     }
		     public void setDownBeamLength(float downBeamLength) {
			       this.downBeamLength = downBeamLength;
			     }

		     public float getDividerLength() {
			       return this.dividerLength;
			     }
		     public void setDividerLength(float dividerLength) {
			       this.dividerLength = dividerLength;
			     }
		     public float getUpBeamLength() {
			       return this.upBeamLength;
			     }
		     public void setUpBeamLength(float upBeamLength) {
			       this.upBeamLength = upBeamLength;
			     }
		     public float getVaneLength() {
			       return this.vaneLength;
			     }
		     public void setVaneLength(float vaneLength) {
			       this.vaneLength = vaneLength;
			     }
		     public String getHingeInstallType() {
			       return this.hingeInstallType;
			     }
		     public void setHingeInstallType(String hingeInstallType) {
			       this.hingeInstallType = hingeInstallType;
			     }
		     public float getBordLength() {
			       return this.bordLength;
			     }
		     public void setBordLength(float bordLength) {
			       this.bordLength = bordLength;
			     }
		     public float getBordWidth() {
			       return this.bordWidth;
			     }
		     public void setBordWidth(float bordWidth) {
			       this.bordWidth = bordWidth;
			     }
		     public int getDistPaneNum() {
			       return this.distPaneNum;
			     }
		     public void setDistPaneNum(int distPaneNum) {
			       this.distPaneNum = distPaneNum;
			     }
		   }

		   // 层计算结果信息
	   class LevelCalResultInfo
			   {
		     private DistinctCalResultInfo[] distInfo = null;
		     private float poleLength; // 立杆长度
		     private float duiKouPoleLength; // 对口立杆长度
		     private float shuangLianPoleLength; // 双连立杆长度
		     private float tPoleLength; // T形立杆长度
		     private float[] tPolePos;  // T形立杆位置
		     private float dividerLength;   // 分隔梁长度
		     private int[] dividerPos; // 分隔梁位置
		     private int singleHingeNum; // 单开合页数量
		     private int doubleHingeNum;  // 双开合页数量
		     private int bendhingeNum; // 弯曲合页数量
		     private float[] pullBarLength;  // 拉杆长度
		     private int[] pullBarNumPerLevel;  // 每层拉杆数量
		     private int levelNum = 0;   // 层数
		     private float upBeamWidth;    // 上梁宽度
		     private float downBeamWidth;  // 下梁宽度
		     private int vaneNumPerPane; // 每扇窗叶片数量
		     private int vaneBoltNumPerPane;
		     private int tenonNumPerPane;
		     private int paneNum; // 窗扇数量

		     public LevelCalResultInfo(int num)
		     {
			       this.levelNum = num;
			       if (num == 1)
				       {
				         setPaneNum(Integer.parseInt(m_OrderInfo.GetPanelNum()));
				       }
			       else if (num == 2)
				       {
				         setPaneNum(Integer.parseInt(m_OrderInfo.getBottomPanelNum()));
				       }
			     }

		     public DistinctCalResultInfo[] getDistInfo() {
			       return this.distInfo;
			     }

		     public void setDistInfo(DistinctCalResultInfo[] distInfo) {
			       this.distInfo = distInfo;
			     }

		     public float getDividerLength() {
			       return this.dividerLength;
			     }

		     public void setDividerLength(float dividerLength) {
			       this.dividerLength = dividerLength;
			     }

		     public int[] getDividerPos() {
			       return this.dividerPos;
			     }

		     public void setDividerPos(int[] dividerPos) {
			       this.dividerPos = dividerPos;
			     }

		     public float getDuiKouPoleLength() {
			       return this.duiKouPoleLength;
			     }

		     public void setDuiKouPoleLength(float duiKouPoleLength) {
			       this.duiKouPoleLength = duiKouPoleLength;
			     }

		     public float getPoleLength() {
			       return this.poleLength;
			     }

		     public void setPoleLength(float poleLength) {
			       this.poleLength = poleLength;
			     }

		     public float getShuangLianPoleLength() {
			       return this.shuangLianPoleLength;
			     }

		     public void setShuangLianPoleLength(float shuangLianPoleLength) {
			       this.shuangLianPoleLength = shuangLianPoleLength;
			     }

		     public float getTPoleLength() {
			       return this.tPoleLength;
			     }

		     public void setTPoleLength(float poleLength) {
			       this.tPoleLength = poleLength;
			     }

		     public float[] getTPolePos() {
			       return this.tPolePos;
			     }

		     public void setTPolePos(float[] polePos) {
			       this.tPolePos = polePos;
			     }

		     public int getBendhingeNum() {
			       return this.bendhingeNum;
			     }
		     public void setBendhingeNum(int bendhingeNum) {
			       this.bendhingeNum = bendhingeNum;
			     }
		     public int getDoubleHingeNum() {
			       return this.doubleHingeNum;
			     }
		     public void setDoubleHingeNum(int doubleHingeNum) {
			       this.doubleHingeNum = doubleHingeNum;
			     }
		     public int getSingleHingeNum() {
			       return this.singleHingeNum;
			     }
		     public void setSingleHingeNum(int singleHingeNum) {
			       this.singleHingeNum = singleHingeNum;
			     }
		     public float[] getPullBarLength() {
			       return this.pullBarLength;
			     }
		     public void setPullBarLength(float[] pullBarLength) {
			       this.pullBarLength = pullBarLength;
			     }
		     public int[] getPullBarNumPerLevel() {
			       return this.pullBarNumPerLevel;
			     }
		     public void setPullBarNumPerLevel(int[] pullBarNumPerLevel) {
			       this.pullBarNumPerLevel = pullBarNumPerLevel;
			     }
		     public float getDownBeamWidth() {
			       return this.downBeamWidth;
			     }
		     public void setDownBeanWidth(float downBeamWidth) {
			       this.downBeamWidth = downBeamWidth;
			     }
		     public float getUpBeamWidth() {
			       return this.upBeamWidth;
			     }
		     public void setUpBeamWidth(float upBeamWidth) {
			       this.upBeamWidth = upBeamWidth;
			     }
		     public int getVaneNumPerPane() {
			       return this.vaneNumPerPane;
			     }
		     public void vaneNumPerPane(int vaneNumPerPane) {
			       this.vaneNumPerPane = vaneNumPerPane;
			     }
		     public int getVaneBoltNumPerPane() {
			       return this.vaneBoltNumPerPane;
			     }
		     public void setVaneBoltNumPerPane(int vaneBoltNumPerPane) {
			       this.vaneBoltNumPerPane = vaneBoltNumPerPane;
			     }
		     public int getTenonNumPerPane() {
			       return this.tenonNumPerPane;
			     }
		     public void setTenonNumPerPane(int tenonNumPerPane) {
			       this.tenonNumPerPane = tenonNumPerPane;
			     }
		     public int getPaneNum() {
			       return this.paneNum;
			     }

		     public void setPaneNum(int paneNum) {
			       this.paneNum = paneNum;
			     }

			     // 计算层关联参数
		     public void calulateLevelRelatedParam()
		     {
			       calHingeNum(); // 计算合页数量
			       calBordWidthAndHeight(); // 计算框宽和高
			       calTotalTenoNum(); // 计算总木榫数量
			       calTotalVaneBoltNum(); // 计算总叶片销
			     }

		     private void calHingeNum()
		     {
			       int singePanelNum = 0; // 单开合页数量
			       int doublePanelNum = 0; // 双开合页数量
			       int bendPanelNum = 0; // 弯曲合页数量

			       // 处理一层的情况
			       if (this.levelNum == 1)
				       {
				         singePanelNum = Integer.parseInt(m_OrderInfo.GetSingleHinge());
				         doublePanelNum = Integer.parseInt(m_OrderInfo.GetDoubleHinge());
				         bendPanelNum = Integer.parseInt(m_OrderInfo.getBendHinge());
				       }
				       // 处理下层情况
			       else if (this.levelNum == 2)
				       {
				         singePanelNum = Integer.parseInt(m_OrderInfo.getBottomSingeHinge());
				         doublePanelNum = Integer.parseInt(m_OrderInfo.getBottomDoubleHinge());
				         bendPanelNum = Integer.parseInt(m_OrderInfo.getBottomBendHinge());
				       }

			       float poleLength = getPoleLength();
			       // 计算系统D 根据立杆长度，立杆越长 合页数量越多
			       int D = 0;

			       if (poleLength <= 1200.0F)
				       {
				         D = 2;
				       }
			       else if (poleLength <= 2000.0F)
				       {
				         D = 3;
				       }
			       else if (poleLength <= 2400.0F)
				       {
				         D = 4;
				       }
			       else if (poleLength > 2400.0F)
				       {
				         D = 5;
				       }
			       setSingleHingeNum(singePanelNum * D);
			       winCalResult.setTotalSingleHingeNum(winCalResult.getTotalSingleHingeNum() + getSingleHingeNum());
			       setDoubleHingeNum(doublePanelNum * D);
			       winCalResult.setTotalBoubleHingeNum(winCalResult.getTotalDoubleHingeNum() + getDoubleHingeNum());
			       setBendhingeNum(bendPanelNum * D);
			       winCalResult.setTotalBendHingeNun(winCalResult.getTotalBendHingeNun() + getBendhingeNum());
			     }

		     private void calBordWidthAndHeight()
		     {
			       float poleLen = 0.0F;
			       float upBeamWidth = 0.0F;
			       float downBeamWidth = 0.0F;
			       float beamLen = 0.0F;
			       float boardWidth = 0.0F;
			       float boardHeight = 0.0F;

			       if ((this.levelNum == 1) && (m_OrderInfo.getIsBoard()))
				       {
				         poleLen = winCalResult.getLeveInfo()[0].getPoleLength();
				         upBeamWidth = winCalResult.getLeveInfo()[0].getUpBeamWidth();
				         downBeamWidth = winCalResult.getLeveInfo()[0].getDownBeamWidth();
				         int i = 0; for (int j = getDistInfo().length; i < j; i++)
					         {
					           beamLen = getDistInfo()[i].getUpBeamLength();
					           boardHeight = poleLen - (upBeamWidth + downBeamWidth) + 20.0F;
					           boardWidth = beamLen + 20.0F;
					           getDistInfo()[i].setBordLength(boardHeight);
					           getDistInfo()[i].setBordWidth(boardWidth);
					         }
				       }
			       else if ((this.levelNum == 2) && (m_OrderInfo.getBottomIsBoard()))
				       {
				         poleLen = winCalResult.getLeveInfo()[1].getPoleLength();
				         upBeamWidth = winCalResult.getLeveInfo()[1].getUpBeamWidth();
				         downBeamWidth = winCalResult.getLeveInfo()[1].getDownBeamWidth();
				         int i = 0; for (int j = getDistInfo().length; i < j; i++)
					         {
					           beamLen = getDistInfo()[i].getUpBeamLength();
					           boardHeight = poleLen - (upBeamWidth + downBeamWidth) + 20.0F;
					           boardWidth = beamLen + 20.0F;
					           getDistInfo()[i].setBordLength(boardHeight);
					           getDistInfo()[i].setBordWidth(boardWidth);
					         }
				       }
			     }

		     private void calTotalVaneBoltNum()
		     {
			       int totalNum = winCalResult.getTotalVaneBolt();
			       totalNum += getVaneBoltNumPerPane() * getPaneNum();
			       winCalResult.setTotalVaneBolt(totalNum);
			     }

		     private void calTotalTenoNum()
		     {
			       int totalNum = winCalResult.getTotaltenonNum();
			       totalNum += getTenonNumPerPane() * getPaneNum();
			       winCalResult.setTotaltenonNum(totalNum);
			     }
		   }

	   class WindowCalResultInfo
			   {
		     private LevelCalResultInfo[] leveInfo = null;
		     private float frameWidth; // 框宽
		     private float frameHeight; // 框高
		     private float totalArea; // 总面积
		     private float hTPoleLength; // 横T长度
		     private int magnetNum; // 磁碰数量
		     private int totaltenonNum; // 总木榫数量
		     private int totalVaneBolt; // 总叶片销
		     private int totalSingleHingeNum; // 单开合页
		     private int totalDoubleHingeNum; // 双开合页
		     private int totalBendHingeNun; // 总弯曲合页
		     private int totalMagnetSliceNum; // 磁片数量
		     private int doublePlasterNum = 0; // 双面胶数量

		     public WindowCalResultInfo() {
			     }

		     public float getFrameHeight() {
			       return this.frameHeight;
			     }

		     public void setFrameHeight(float frameHeight) {
			       this.frameHeight = frameHeight;
			     }

		     public float getFrameWidth() {
			       return this.frameWidth;
			     }

		     public void setFrameWidth(float frameWidth) {
			       this.frameWidth = frameWidth;
			     }

		     public float getHTPoleLength() {
			       return this.hTPoleLength;
			     }

		     public void setHTPoleLength(float poleLength) {
			       this.hTPoleLength = poleLength;
			     }

		     public LevelCalResultInfo[] getLeveInfo() {
			       return this.leveInfo;
			     }

		     public void setLeveInfo(LevelCalResultInfo[] leveInfo) {
			       this.leveInfo = leveInfo;
			     }

		     public float getTotalArea() {
			       return this.totalArea;
			     }

		     public void setTotalArea(float totalArea) {
			       this.totalArea = totalArea;
			     }

		     public int getMagnetNum() {
			       return this.magnetNum;
			     }
		     public void setMagnetNum(int magnetNum) {
			       this.magnetNum = magnetNum;
			     }

		     public int getTotaltenonNum() {
			       return this.totaltenonNum;
			     }

		     public void setTotaltenonNum(int totaltenonNum) {
			       this.totaltenonNum = totaltenonNum;
			     }

		     public int getTotalVaneBolt() {
			       return this.totalVaneBolt;
			     }

		     public void setTotalVaneBolt(int totalVaneBolt) {
			       this.totalVaneBolt = totalVaneBolt;
			     }

		     public int getTotalBendHingeNun() {
			       return this.totalBendHingeNun;
			     }

		     public void setTotalBendHingeNun(int totalBendHingeNun) {
			       this.totalBendHingeNun = totalBendHingeNun;
			     }

		     public int getTotalDoubleHingeNum() {
			       return this.totalDoubleHingeNum;
			     }

		     public void setTotalBoubleHingeNum(int totalDoubleHingeNum) {
			       this.totalDoubleHingeNum = totalDoubleHingeNum;
			     }

		     public int getTotalSingleHingeNum() {
			       return this.totalSingleHingeNum;
			     }

		     public void setTotalSingleHingeNum(int totalSingleHingeNum) {
			       this.totalSingleHingeNum = totalSingleHingeNum;
			     }

		     public int getTotalMagnetSliceNum() {
			       return this.totalMagnetSliceNum;
			     }

		     public void setTotalMagnetSliceNum(int totalMagnetSliceNum) {
			       this.totalMagnetSliceNum = totalMagnetSliceNum;
			     }

		     public int getDoublePlasterNum() {
			       return this.doublePlasterNum;
			     }

		     public void setDoublePlasterNum(int doublePlasterNum) {
			       this.doublePlasterNum = doublePlasterNum;
			     }
		   }

	   public class JeruGraphics
			   {
		     BufferedImage image;

		     public JeruGraphics()
		     {
			     }

		     public void HingeInstallAnalysis(String strHingeInstallType)
		     {
			     }

		     void drawFrame(int lbx, int lby, int width, int height, Graphics g)
		     {
		     	// 外框数量和位置
			       int frameNumPos = m_OrderInfo.GetFrameNumPos();

			       if (frameNumPos == 2)
				       {
				         return;
				       }

			       if ((frameNumPos != 4) && (frameNumPos != 5) && (frameNumPos != 6) && (frameNumPos != 7))
				       {
				         g.drawLine(lbx + 10, lby, lbx + 10 + 100 + width, lby);
				         g.drawLine(lbx + 10 + 50, lby + 50, lbx + 10 + 50 + width, lby + 50);
				         g.drawLine(lbx + 10, lby, lbx + 10 + 50, lby + 50);
				         g.drawLine(lbx + 10 + 100 + width, lby, lbx + 10 + 50 + width, lby + 50);
				       }

			       if ((frameNumPos != 3) && (frameNumPos != 5) && (frameNumPos != 6) && (frameNumPos != 7))
				       {
				         if (frameNumPos == 1) {
					           g.drawLine(lbx + 10 + 30, lby + 70 + height, lbx + 10 + 30 + 40 + width, lby + 70 + height);
					           g.drawLine(lbx + 10 + 50, lby + 50 + height, lbx + 10 + 50 + width, lby + 50 + height);
					           g.drawLine(lbx + 10 + 30, lby + 70 + height, lbx + 10 + 50, lby + 50 + height);
					           g.drawLine(lbx + 10 + 30 + 40 + width, lby + 70 + height, lbx + 10 + 50 + width, lby + 50 + height);
					         }
				         else
					         {
					           g.drawLine(lbx + 10, lby + 100 + height, lbx + 10 + 100 + width, lby + 100 + height);
					           g.drawLine(lbx + 10 + 50, lby + 50 + height, lbx + 10 + 50 + width, lby + 50 + height);
					           g.drawLine(lbx + 10, lby + 100 + height, lbx + 10 + 50, lby + 50 + height);
					           g.drawLine(lbx + 10 + 100 + width, lby + 100 + height, lbx + 10 + 50 + width, lby + 50 + height);
					         }
				       }

			       if (frameNumPos != 6)
				       {
				         if (frameNumPos == 4) {
					           g.drawLine(lbx, lby + 50, lbx, lby + 100 + height);
					           g.drawLine(lbx + 50, lby + 50, lbx + 50, lby + 50 + height);
					           g.drawLine(lbx, lby + 50, lbx + 50, lby + 50);
					           g.drawLine(lbx, lby + 100 + height, lbx + 50, lby + 50 + height);
					         }
				         else if (frameNumPos == 3) {
					           g.drawLine(lbx, lby, lbx, lbx + 50 + height);
					           g.drawLine(lbx + 50, lby + 50, lbx + 50, lby + 50 + height);
					           g.drawLine(lbx, lby, lbx + 50, lby + 50);
					           g.drawLine(lbx, lbx + 50 + height, lbx + 50, lby + 50 + height);
					         }
				         else if ((frameNumPos == 7) || (frameNumPos == 5)) {
					           g.drawLine(lbx, lby + 50, lbx, lby + 50 + height);
					           g.drawLine(lbx + 50, lby + 50, lbx + 50, lby + 50 + height);
					           g.drawLine(lbx, lby + 50, lbx + 50, lby + 50);
					           g.drawLine(lbx, lby + 50 + height, lbx + 50, lby + 50 + height);
					         }
				         else if (frameNumPos == 1) {
					           g.drawLine(lbx, lby, lbx, lby + 70 + height);
					           g.drawLine(lbx + 50, lby + 50, lbx + 50, lby + 50 + height);
					           g.drawLine(lbx, lby, lbx + 50, lby + 50);
					           g.drawLine(lbx, lby + 70 + height, lbx + 30, lby + 70 + height);
					           g.drawLine(lbx + 50, lby + 50 + height, lbx + 30, lby + 70 + height);
					         }
				         else {
					           g.drawLine(lbx, lby, lbx, lby + 100 + height);
					           g.drawLine(lbx + 50, lby + 50, lbx + 50, lby + 50 + height);
					           g.drawLine(lbx, lby, lbx + 50, lby + 50);
					           g.drawLine(lbx, lby + 100 + height, lbx + 50, lby + 50 + height);
					         }
				       }

			       if (frameNumPos != 5)
				       {
				         if (frameNumPos == 4) {
					           g.drawLine(lbx + 10 + 10 + 100 + width, lby + 50, lbx + 10 + 10 + 100 + width, lby + 100 + height);
					           g.drawLine(lbx + 10 + 10 + 50 + width, lby + 50, lbx + 10 + 10 + 50 + width, lby + 50 + height);
					           g.drawLine(lbx + 10 + 10 + 100 + width, lby + 50, lbx + 10 + 10 + 50 + width, lby + 50);
					           g.drawLine(lbx + 10 + 10 + 100 + width, lby + 100 + height, lbx + 10 + 10 + 50 + width, lby + 50 + height);
					         }
				         else if (frameNumPos == 3) {
					           g.drawLine(lbx + 10 + 10 + 100 + width, lby, lbx + 10 + 10 + 100 + width, lby + 50 + height);
					           g.drawLine(lbx + 10 + 10 + 50 + width, lby + 50, lbx + 10 + 10 + 50 + width, lby + 50 + height);
					           g.drawLine(lbx + 10 + 10 + 100 + width, lby, lbx + 10 + 10 + 50 + width, lby + 50);
					           g.drawLine(lbx + 10 + 10 + 100 + width, lby + 50 + height, lbx + 10 + 10 + 50 + width, lby + 50 + height);
					         }
				         else if ((frameNumPos == 7) || (frameNumPos == 6)) {
					           g.drawLine(lbx + 10 + 10 + 100 + width, lby + 50, lbx + 10 + 10 + 100 + width, lby + 50 + height);
					           g.drawLine(lbx + 10 + 10 + 50 + width, lby + 50, lbx + 10 + 10 + 50 + width, lby + 50 + height);
					           g.drawLine(lbx + 10 + 10 + 100 + width, lby + 50, lbx + 10 + 10 + 50 + width, lby + 50);
					           g.drawLine(lbx + 10 + 10 + 100 + width, lby + 50 + height, lbx + 10 + 10 + 50 + width, lby + 50 + height);
					         }
				         else if (frameNumPos == 1) {
					           g.drawLine(lbx + 10 + 10 + 100 + width, lby, lbx + 10 + 10 + 100 + width, lby + 70 + height);
					           g.drawLine(lbx + 10 + 10 + 50 + width, lby + 50, lbx + 10 + 10 + 50 + width, lby + 50 + height);
					           g.drawLine(lbx + 10 + 10 + 100 + width, lby, lbx + 10 + 10 + 50 + width, lby + 50);
					           g.drawLine(lbx + 10 + 10 + 100 + width, lby + 70 + height, lbx + 10 + 10 + 70 + width, lby + 70 + height);
					           g.drawLine(lbx + 10 + 10 + 50 + width, lby + 50 + height, lbx + 10 + 10 + 70 + width, lby + 70 + height);
					         }
				         else {
					           g.drawLine(lbx + 10 + 10 + 100 + width, lby, lbx + 10 + 10 + 100 + width, lby + 100 + height);
					           g.drawLine(lbx + 10 + 10 + 50 + width, lby + 50, lbx + 10 + 10 + 50 + width, lby + 50 + height);
					           g.drawLine(lbx + 10 + 10 + 100 + width, lby, lbx + 10 + 10 + 50 + width, lby + 50);
					           g.drawLine(lbx + 10 + 10 + 100 + width, lby + 100 + height, lbx + 10 + 10 + 50 + width, lby + 50 + height);
					         }
				       }
			     }

		     void drawPanel(float xb, float yb, Graphics g)
		     {
			       float strartXb = xb;

			       // 层信息
			       LevelCalResultInfo levelInfo = winCalResult.getLeveInfo()[0];
			       DistinctCalResultInfo[] distInfos = levelInfo.getDistInfo();
			       int distPaneNum = 0;
			       float poleLen = levelInfo.getPoleLength();
			       for (int i = 0; i < distInfos.length; i++)
				       {
				         distPaneNum = distInfos[i].getDistPaneNum();

				         int D = 0;
				         if (poleLen <= 1200.0F)
					         {
					           D = 2;
					         }
				         else if (poleLen <= 2000.0F)
					         {
					           D = 3;
					         }
				         else if (poleLen <= 2400.0F)
					         {
					           D = 4;
					         }
				         else if (poleLen > 2400.0F)
					         {
					           D = 5;
					         }

				         for (int j = 0; j < distPaneNum; j++)
					         {
					           char hingeInstallSide = CalculateUtils.getHingeInstallSides(distInfos[i].getHingeInstallType(), j);

					           float gap = CalculateUtils.getHingeInstallGap(distInfos[i].getHingeInstallType(), j);
					           xb += gap;

					           g.drawRect((int)xb, (int)yb, 50, (int)poleLen);

					           if (hingeInstallSide == CalculateUtils.LEFT_SIDE_HINGE)
						           {
						             for (int ii = 0; ii < D; ii++) {
							               g.drawRect((int)(xb - 7.0F), (int)(yb + (ii + 1) * poleLen / (D + 1)), 14, 50);
							               g.setColor(Color.BLACK);
							               g.fillRect((int)(xb - 7.0F), (int)(yb + (ii + 1) * poleLen / (D + 1)), 14, 50);
							             }

						           }

					           g.setColor(Color.BLACK);
					           g.drawRect((int)(xb + 50.799999999999997D), (int)yb, (int)distInfos[i].getUpBeamLength(), (int)levelInfo.getUpBeamWidth());
					           g.setColor(Color.LIGHT_GRAY);
					           g.fillRect((int)(xb + 50.799999999999997D), (int)yb, (int)distInfos[i].getUpBeamLength(), (int)levelInfo.getUpBeamWidth());
					           g.setColor(Color.BLACK);

					           g.drawRect((int)(xb + 50.799999999999997D), (int)(yb + poleLen - levelInfo.getDownBeamWidth()), (int)distInfos[i].getDownBeamLength(), (int)levelInfo.getDownBeamWidth());
					           g.setColor(Color.LIGHT_GRAY);
					           g.fillRect((int)(xb + 50.799999999999997D), (int)(yb + poleLen - levelInfo.getDownBeamWidth()), (int)distInfos[i].getDownBeamLength(), (int)levelInfo.getDownBeamWidth());
					           g.setColor(Color.BLACK);

					           if (!m_OrderInfo.getIsBoard())
						           {
						             int vaneType = m_OrderInfo.GetVaneType();
						             float vaneWidth = 0.0F;
						             if ((vaneType == 0) || (vaneType == 1) || (vaneType == 2))
							             {
							               vaneWidth = Float.parseFloat(Constants.VANETYPE[vaneType]) - 12.7F;
							             }
						             else if (vaneType == 3)
							             {
							               vaneWidth = Float.parseFloat(Constants.VANETYPE[vaneType]) - 8.0F;
							             }
						             else
							             {
							               vaneWidth = Float.parseFloat(Constants.VANETYPE[vaneType]) - 6.0F;
							             }
						             int dividerNum = Integer.parseInt(m_OrderInfo.GetDividerNum());
						             if (dividerNum > 0)
							             {
							               int[] dividerPos = levelInfo.getDividerPos();
							               float[] pullBarLen = levelInfo.getPullBarLength();
							               int[] pullullBarNumPerLevel = levelInfo.getPullBarNumPerLevel();
							               int drawedVaneNum = 0;
							               int drawedDividerNum = 0;
							               int dividerType = m_OrderInfo.GetDividerType();
							               float dividerWidth = 0.0F;
							               if (dividerType != -1)
								               {
								                 dividerWidth = Float.parseFloat(Constants.DIVIDERTYPE[dividerType]);
								               }
							               for (int m = dividerNum; m >= 0; m--)
								               {
								                 int num = 0;
								                 if (m == dividerNum)
									                 {
									                   num = levelInfo.getVaneNumPerPane();
									                   for (int n = 0; n < m; n++)
										                   {
										                     num -= dividerPos[n];
										                   }
									                 }
								                 else
									                 {
									                   num = dividerPos[m];
									                 }
								                 for (int k = 1; k <= num; k++)
									                 {
									                   drawedVaneNum++;
									                   int x0 = (int)(xb + 50.799999999999997D);
									                   int y0 = (int)(yb + levelInfo.getUpBeamWidth() + drawedVaneNum * vaneWidth + drawedDividerNum * dividerWidth);
									                   int x1 = (int)(xb + 50.799999999999997D + distInfos[i].getDownBeamLength());
									                   int y1 = (int)(yb + levelInfo.getUpBeamWidth() + drawedVaneNum * vaneWidth + drawedDividerNum * dividerWidth);
									                   g.drawLine(x0, y0, x1, y1);
									                 }

								                 if (m_OrderInfo.GetPullBarType() != 1) {
									                   int pullBarX = 0;

									                   if (m_OrderInfo.GetPullBarType() == 0) {
										                     pullBarX = (int)(xb + 50.799999999999997D + distInfos[i].getDownBeamLength() / 2.0F);
										                   }
									                   else if (m_OrderInfo.GetPullBarType() == 2) {
										                     if (hingeInstallSide == CalculateUtils.RIGHT_SIDE_HINGE) {
											                       pullBarX = (int)(xb + 50.799999999999997D + distInfos[i].getDownBeamLength() / 3.0F * 2.0F);
											                     }
										                     else if (hingeInstallSide == CalculateUtils.LEFT_SIDE_HINGE) {
											                       pullBarX = (int)(xb + 50.799999999999997D + distInfos[i].getDownBeamLength() / 3.0F);
											                     }
										                   }

									                   int pullBarY = 0;
									                   if (drawedDividerNum == 0)
										                   {
										                     pullBarY = (int)(yb + levelInfo.getUpBeamWidth()) - 5;
										                   }
									                   else
										                   {
										                     pullBarY = (int)(yb + levelInfo.getUpBeamWidth() + (drawedVaneNum - num) * vaneWidth + drawedDividerNum * dividerWidth) - 5;
										                   }
									                   if (pullullBarNumPerLevel[2] == 2)
										                   {
										                     g.drawRect(pullBarX, pullBarY, 15, (int)pullBarLen[m]);
										                     g.setColor(Color.LIGHT_GRAY);
										                     g.fillRect(pullBarX, pullBarY, 15, (int)pullBarLen[m]);

										                     g.drawRect(pullBarX, pullBarY + (int)vaneWidth / 3 + (int)pullBarLen[m], 15, (int)pullBarLen[m]);
										                     g.setColor(Color.LIGHT_GRAY);
										                     g.fillRect(pullBarX, pullBarY + (int)vaneWidth / 3 + (int)pullBarLen[m], 15, (int)pullBarLen[m]);
										                     g.setColor(Color.BLACK);
										                   }
									                   else
										                   {
										                     g.drawRect(pullBarX, pullBarY, 15, (int)pullBarLen[m]);
										                     g.setColor(Color.LIGHT_GRAY);
										                     g.fillRect(pullBarX, pullBarY, 15, (int)pullBarLen[m]);
										                     g.setColor(Color.BLACK);
										                   }
									                 }

								                 if (m <= 0)
									                   continue;
								                 int x0 = (int)(xb + 50.799999999999997D);
								                 int y0 = (int)(yb + levelInfo.getUpBeamWidth() + drawedVaneNum * vaneWidth + drawedDividerNum * dividerWidth);
								                 g.drawRect(x0, y0, (int)distInfos[i].getUpBeamLength(), (int)dividerWidth);
								                 g.setColor(Color.LIGHT_GRAY);
								                 g.fillRect(x0, y0, (int)distInfos[i].getUpBeamLength(), (int)dividerWidth);
								                 g.setColor(Color.BLACK);
								                 drawedDividerNum++;
								               }

							             }
						             else
							             {
							               int num = levelInfo.getVaneNumPerPane();
							               for (int k = 1; k <= num; k++)
								               {
								                 int x0 = (int)(xb + 50.799999999999997D);
								                 int y0 = (int)(yb + levelInfo.getUpBeamWidth() + k * vaneWidth);
								                 int x1 = (int)(xb + 50.799999999999997D + distInfos[i].getDownBeamLength());
								                 int y1 = (int)(yb + levelInfo.getUpBeamWidth() + k * vaneWidth);
								                 g.drawLine(x0, y0, x1, y1);
								               }

							               if (m_OrderInfo.GetPullBarType() != 1) {
								                 int pullBarX = 0;

								                 if (m_OrderInfo.GetPullBarType() == 0) {
									                   pullBarX = (int)(xb + 50.799999999999997D + distInfos[i].getDownBeamLength() / 2.0F);
									                 }
								                 else if (m_OrderInfo.GetPullBarType() == 2) {
									                   if (hingeInstallSide == CalculateUtils.RIGHT_SIDE_HINGE) {
										                     pullBarX = (int)(xb + 50.799999999999997D + distInfos[i].getDownBeamLength() / 3.0F * 2.0F);
										                   }
									                   else if (hingeInstallSide == CalculateUtils.LEFT_SIDE_HINGE) {
										                     pullBarX = (int)(xb + 50.799999999999997D + distInfos[i].getDownBeamLength() / 3.0F);
										                   }
									                 }
								                 int pullBarY = (int)(yb + levelInfo.getUpBeamWidth()) - 5;
								                 if (levelInfo.getPullBarNumPerLevel()[0] == 2)
									                 {
									                   g.drawRect(pullBarX, pullBarY, 15, (int)levelInfo.getPullBarLength()[0]);
									                   g.setColor(Color.LIGHT_GRAY);
									                   g.fillRect(pullBarX, pullBarY, 15, (int)levelInfo.getPullBarLength()[0]);

									                   g.drawRect(pullBarX, pullBarY + (int)vaneWidth / 3 + (int)levelInfo.getPullBarLength()[0], 15, (int)levelInfo.getPullBarLength()[0]);
									                   g.setColor(Color.LIGHT_GRAY);
									                   g.fillRect(pullBarX, pullBarY + (int)vaneWidth / 3 + (int)levelInfo.getPullBarLength()[0], 15, (int)levelInfo.getPullBarLength()[0]);
									                   g.setColor(Color.BLACK);
									                 }
								                 else
									                 {
									                   g.drawRect(pullBarX, pullBarY, 15, (int)levelInfo.getPullBarLength()[0]);
									                   g.setColor(Color.LIGHT_GRAY);
									                   g.fillRect(pullBarX, pullBarY, 15, (int)levelInfo.getPullBarLength()[0]);
									                   g.setColor(Color.BLACK);
									                 }
								               }
							             }

						           }

					           g.drawRect((int)(xb + 50.799999999999997D + distInfos[i].getUpBeamLength()), (int)yb, 50, (int)poleLen);
					           xb += (int)(101.59999999999999D + distInfos[i].getUpBeamLength());

					           if ((hingeInstallSide != CalculateUtils.RIGHT_SIDE_HINGE) || (i < distInfos.length - 1))
						             continue;
					           for (int ii = 0; ii < D; ii++) {
						             g.drawRect((int)xb - 7, (int)(yb + (ii + 1) * poleLen / (D + 1)), 14, 50);
						             g.setColor(Color.BLACK);
						             g.fillRect((int)xb - 7, (int)(yb + (ii + 1) * poleLen / (D + 1)), 14, 50);
						           }

					         }

				         if (i >= distInfos.length - 1)
					           continue;
				         float tPoleLen = levelInfo.getTPoleLength();
				         g.drawRect((int)(xb + 3.17D), (int)yb, 25, (int)tPoleLen);
				         g.setColor(Color.LIGHT_GRAY);
				         g.fillRect((int)(xb + 3.17D), (int)yb, 25, (int)tPoleLen);
				         g.setColor(Color.BLACK);

				         if (CalculateUtils.getHingeInstallSides(distInfos[i].getHingeInstallType(), distPaneNum - 1) == CalculateUtils.RIGHT_SIDE_HINGE)
					         {
					           for (int ii = 0; ii < D; ii++) {
						             g.drawRect((int)xb - 7, (int)(yb + (ii + 1) * poleLen / (D + 1)), 14, 50);
						             g.setColor(Color.BLACK);
						             g.fillRect((int)xb - 7, (int)(yb + (ii + 1) * poleLen / (D + 1)), 14, 50);
						           }
					         }

				         xb += 28.0F;
				       }

			       if (m_OrderInfo.GetLevel().trim().equals("2"))
				       {
				         xb = strartXb;

				         yb = yb + poleLen + 3.175F;

				         if (m_OrderInfo.getHTPoleExist())
					         {
					           float htLen = winCalResult.getHTPoleLength();
					           g.drawRect((int)xb, (int)yb, (int)htLen, 25);
					           g.setColor(Color.LIGHT_GRAY);
					           g.fillRect((int)xb, (int)yb, (int)htLen, 25);
					           g.setColor(Color.BLACK);
					           yb = yb + 25.4F + 3.175F;
					         }
				         else
					         {
					           yb += 3.175F;
					         }

				         levelInfo = winCalResult.getLeveInfo()[1];
				         distInfos = levelInfo.getDistInfo();
				         distPaneNum = 0;
				         poleLen = levelInfo.getPoleLength();

				         int D = 0;
				         if (poleLen <= 1200.0F)
					         {
					           D = 2;
					         }
				         else if (poleLen <= 2000.0F)
					         {
					           D = 3;
					         }
				         else if (poleLen <= 2400.0F)
					         {
					           D = 4;
					         }
				         else if (poleLen > 2400.0F)
					         {
					           D = 5;
					         }

				         for (int i = 0; i < distInfos.length; i++)
					         {
					           distPaneNum = distInfos[i].getDistPaneNum();

					           for (int j = 0; j < distPaneNum; j++)
						           {
						             char hingeInstallSide = CalculateUtils.getHingeInstallSides(distInfos[i].getHingeInstallType(), j);

						             float gap = CalculateUtils.getHingeInstallGap(distInfos[i].getHingeInstallType(), j);
						             xb += gap;

						             g.drawRect((int)xb, (int)yb, 50, (int)poleLen);

						             if (hingeInstallSide == CalculateUtils.LEFT_SIDE_HINGE)
							             {
							               for (int ii = 0; ii < D; ii++) {
								                 g.drawRect((int)(xb - 7.0F), (int)(yb + (ii + 1) * poleLen / (D + 1)), 14, 50);
								                 g.setColor(Color.BLACK);
								                 g.fillRect((int)(xb - 7.0F), (int)(yb + (ii + 1) * poleLen / (D + 1)), 14, 50);
								               }

							             }

						             g.drawRect((int)(xb + 50.799999999999997D), (int)yb, (int)distInfos[i].getUpBeamLength(), (int)levelInfo.getUpBeamWidth());
						             g.setColor(Color.LIGHT_GRAY);
						             g.fillRect((int)(xb + 50.799999999999997D), (int)yb, (int)distInfos[i].getUpBeamLength(), (int)levelInfo.getUpBeamWidth());
						             g.setColor(Color.BLACK);

						             g.drawRect((int)(xb + 50.799999999999997D), (int)(yb + poleLen - levelInfo.getDownBeamWidth()), (int)distInfos[i].getDownBeamLength(), (int)levelInfo.getDownBeamWidth());
						             g.setColor(Color.LIGHT_GRAY);
						             g.fillRect((int)(xb + 50.799999999999997D), (int)(yb + poleLen - levelInfo.getDownBeamWidth()), (int)distInfos[i].getDownBeamLength(), (int)levelInfo.getDownBeamWidth());
						             g.setColor(Color.BLACK);

						             if (!m_OrderInfo.getBottomIsBoard())
							             {
							               String vaneWidthStr = m_OrderInfo.getBottomVaneType();
							               float vaneWidth = 0.0F;
							               if (!CurtainChecker.isEmpty(vaneWidthStr))
								               {
								                 if ((vaneWidthStr.trim().equals(Constants.VANETYPE[0])) || (vaneWidthStr.trim().equals(Constants.VANETYPE[1])) || (vaneWidthStr.trim().equals(Constants.VANETYPE[2])))
									                 {
									                   vaneWidth = Float.parseFloat(vaneWidthStr) - 12.7F;
									                 }
								                 else if (vaneWidthStr.trim().equals(Constants.VANETYPE[3]))
									                 {
									                   vaneWidth = Float.parseFloat(vaneWidthStr) - 8.0F;
									                 }
								                 else if (vaneWidthStr.trim().equals(Constants.VANETYPE[4]))
									                 {
									                   vaneWidth = Float.parseFloat(vaneWidthStr) - 6.0F;
									                 }
								               }

							               int dividerNum = 0;
							               if (!CurtainChecker.isEmpty(m_OrderInfo.getBottomDividerNum()))
								               {
								                 dividerNum = Integer.parseInt(m_OrderInfo.getBottomDividerNum());
								               }
							               if (dividerNum > 0)
								               {
								                 int[] dividerPos = levelInfo.getDividerPos();
								                 float[] pullBarLen = levelInfo.getPullBarLength();
								                 int[] pullullBarNumPerLevel = levelInfo.getPullBarNumPerLevel();
								                 int drawedVaneNum = 0;
								                 int drawedDividerNum = 0;
								                 String dividerWidthStr = m_OrderInfo.getBottomDividerType();
								                 float dividerWidth = 0.0F;
								                 if (!CurtainChecker.isEmpty(dividerWidthStr))
									                 {
									                   dividerWidth = Float.parseFloat(dividerWidthStr);
									                 }
								                 for (int m = dividerNum; m >= 0; m--)
									                 {
									                   int num = 0;
									                   if (m == dividerNum)
										                   {
										                     num = levelInfo.getVaneNumPerPane();
										                     for (int n = 0; n < m; n++)
											                     {
											                       num -= dividerPos[n];
											                     }
										                   }
									                   else
										                   {
										                     num = dividerPos[m];
										                   }
									                   for (int k = 1; k <= num; k++)
										                   {
										                     drawedVaneNum++;
										                     int x0 = (int)(xb + 50.799999999999997D);
										                     int y0 = (int)(yb + levelInfo.getUpBeamWidth() + drawedVaneNum * vaneWidth + drawedDividerNum * dividerWidth);
										                     int x1 = (int)(xb + 50.799999999999997D + distInfos[i].getDownBeamLength());
										                     int y1 = (int)(yb + levelInfo.getUpBeamWidth() + drawedVaneNum * vaneWidth + drawedDividerNum * dividerWidth);
										                     g.drawLine(x0, y0, x1, y1);
										                   }

									                   if (m_OrderInfo.GetPullBarType() != 1) {
										                     int pullBarX = 0;

										                     if (m_OrderInfo.GetPullBarType() == 0) {
											                       pullBarX = (int)(xb + 50.799999999999997D + distInfos[i].getDownBeamLength() / 2.0F);
											                     }
										                     else if (m_OrderInfo.GetPullBarType() == 2) {
											                       if (hingeInstallSide == CalculateUtils.RIGHT_SIDE_HINGE) {
												                         pullBarX = (int)(xb + 50.799999999999997D + distInfos[i].getDownBeamLength() / 3.0F * 2.0F);
												                       }
											                       else if (hingeInstallSide == CalculateUtils.LEFT_SIDE_HINGE) {
												                         pullBarX = (int)(xb + 50.799999999999997D + distInfos[i].getDownBeamLength() / 3.0F);
												                       }
											                     }

										                     int pullBarY = 0;
										                     if (drawedDividerNum == 0)
											                     {
											                       pullBarY = (int)(yb + levelInfo.getUpBeamWidth()) - 5;
											                     }
										                     else
											                     {
											                       pullBarY = (int)(yb + levelInfo.getUpBeamWidth() + (drawedVaneNum - num) * vaneWidth + drawedDividerNum * dividerWidth) - 5;
											                     }
										                     if (pullullBarNumPerLevel[2] == 2)
											                     {
											                       g.drawRect(pullBarX, pullBarY, 15, (int)pullBarLen[m]);
											                       g.setColor(Color.LIGHT_GRAY);
											                       g.fillRect(pullBarX, pullBarY, 15, (int)pullBarLen[m]);

											                       g.drawRect(pullBarX, pullBarY + (int)vaneWidth / 3 + (int)pullBarLen[m], 15, (int)pullBarLen[m]);
											                       g.setColor(Color.LIGHT_GRAY);
											                       g.fillRect(pullBarX, pullBarY + (int)vaneWidth / 3 + (int)pullBarLen[m], 15, (int)pullBarLen[m]);
											                       g.setColor(Color.BLACK);
											                     }
										                     else
											                     {
											                       g.drawRect(pullBarX, pullBarY, 15, (int)pullBarLen[m]);
											                       g.setColor(Color.LIGHT_GRAY);
											                       g.fillRect(pullBarX, pullBarY, 15, (int)pullBarLen[m]);
											                       g.setColor(Color.BLACK);
											                     }
										                   }

									                   if (m <= 0)
										                     continue;
									                   int x0 = (int)(xb + 50.799999999999997D);
									                   int y0 = (int)(yb + levelInfo.getUpBeamWidth() + drawedVaneNum * vaneWidth + drawedDividerNum * dividerWidth);
									                   g.drawRect(x0, y0, (int)distInfos[i].getUpBeamLength(), (int)dividerWidth);
									                   g.setColor(Color.LIGHT_GRAY);
									                   g.fillRect(x0, y0, (int)distInfos[i].getUpBeamLength(), (int)dividerWidth);
									                   g.setColor(Color.BLACK);
									                   drawedDividerNum++;
									                 }

								               }
							               else
								               {
								                 int num = levelInfo.getVaneNumPerPane();
								                 for (int k = 1; k <= num; k++)
									                 {
									                   int x0 = (int)(xb + 50.799999999999997D);
									                   int y0 = (int)(yb + levelInfo.getUpBeamWidth() + k * vaneWidth);
									                   int x1 = (int)(xb + 50.799999999999997D + distInfos[i].getDownBeamLength());
									                   int y1 = (int)(yb + levelInfo.getUpBeamWidth() + k * vaneWidth);
									                   g.drawLine(x0, y0, x1, y1);
									                 }

								                 if (m_OrderInfo.GetPullBarType() != 1) {
									                   int pullBarX = 0;

									                   if (m_OrderInfo.GetPullBarType() == 0) {
										                     pullBarX = (int)(xb + 50.799999999999997D + distInfos[i].getDownBeamLength() / 2.0F);
										                   }
									                   else if (m_OrderInfo.GetPullBarType() == 2) {
										                     if (hingeInstallSide == CalculateUtils.RIGHT_SIDE_HINGE) {
											                       pullBarX = (int)(xb + 50.799999999999997D + distInfos[i].getDownBeamLength() / 3.0F * 2.0F);
											                     }
										                     else if (hingeInstallSide == CalculateUtils.LEFT_SIDE_HINGE) {
											                       pullBarX = (int)(xb + 50.799999999999997D + distInfos[i].getDownBeamLength() / 3.0F);
											                     }
										                   }
									                   int pullBarY = (int)(yb + levelInfo.getUpBeamWidth()) - 5;
									                   if (levelInfo.getPullBarNumPerLevel()[0] == 2)
										                   {
										                     g.drawRect(pullBarX, pullBarY, 15, (int)levelInfo.getPullBarLength()[0]);
										                     g.setColor(Color.LIGHT_GRAY);
										                     g.fillRect(pullBarX, pullBarY, 15, (int)levelInfo.getPullBarLength()[0]);

										                     g.drawRect(pullBarX, pullBarY + (int)vaneWidth / 2 + (int)levelInfo.getPullBarLength()[0], 15, (int)levelInfo.getPullBarLength()[0]);
										                     g.setColor(Color.LIGHT_GRAY);
										                     g.fillRect(pullBarX, pullBarY + (int)vaneWidth / 2 + (int)levelInfo.getPullBarLength()[0], 15, (int)levelInfo.getPullBarLength()[0]);
										                     g.setColor(Color.BLACK);
										                   }
									                   else
										                   {
										                     g.drawRect(pullBarX, pullBarY, 15, (int)levelInfo.getPullBarLength()[0]);
										                     g.setColor(Color.LIGHT_GRAY);
										                     g.fillRect(pullBarX, pullBarY, 15, (int)levelInfo.getPullBarLength()[0]);
										                     g.setColor(Color.BLACK);
										                   }
									                 }
								               }

							             }

						             g.drawRect((int)(xb + 50.799999999999997D + distInfos[i].getUpBeamLength()), (int)yb, 50, (int)poleLen);
						             xb += (int)(101.59999999999999D + distInfos[i].getUpBeamLength());

						             if ((hingeInstallSide != CalculateUtils.RIGHT_SIDE_HINGE) || (i < distInfos.length - 1))
							               continue;
						             for (int ii = 0; ii < D; ii++) {
							               g.drawRect((int)xb - 7, (int)(yb + (ii + 1) * poleLen / (D + 1)), 14, 50);
							               g.setColor(Color.BLACK);
							               g.fillRect((int)xb - 7, (int)(yb + (ii + 1) * poleLen / (D + 1)), 14, 50);
							             }

						           }

					           if (i >= distInfos.length - 1)
						             continue;
					           if (m_OrderInfo.getHTPoleExist())
						           {
						             float tPoleLen = levelInfo.getTPoleLength();
						             g.drawRect((int)(xb + 3.17D), (int)yb, 25, (int)tPoleLen);
						             g.setColor(Color.LIGHT_GRAY);
						             g.fillRect((int)(xb + 3.17D), (int)yb, 25, (int)tPoleLen);
						             g.setColor(Color.BLACK);
						           }
					           if (CalculateUtils.getHingeInstallSides(distInfos[i].getHingeInstallType(), distPaneNum - 1) == CalculateUtils.RIGHT_SIDE_HINGE)
						           {
						             for (int ii = 0; ii < D; ii++) {
							               g.drawRect((int)xb - 7, (int)(yb + (ii + 1) * poleLen / (D + 1)), 14, 50);
							               g.setColor(Color.BLACK);
							               g.fillRect((int)xb - 7, (int)(yb + (ii + 1) * poleLen / (D + 1)), 14, 50);
							             }
						           }

					           xb += 28.0F;
					         }
				       }
			     }

		     public void createJpg(String path)
		     {
			       try
				       {
				         FileOutputStream fos = new FileOutputStream(path);
				         BufferedOutputStream bos = new BufferedOutputStream(fos);
				         JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(bos);
				         encoder.encode(this.image);
				         bos.close();
				       } catch (FileNotFoundException fnfe) {
				         System.out.println(fnfe);
				       } catch (IOException ioe) {
				         System.out.println(ioe);
				       }
			     }

		     public void DrawPic()
		     {
			       int width = StrictMath.round(winCalResult.getFrameWidth());
			       int height = StrictMath.round(winCalResult.getFrameHeight());

			       //JeruGraphics jg = new JeruGraphics(;
			       JeruGraphics jg = new JeruGraphics();
			       jg.image = new BufferedImage(width + 200, height + 200, 1);
			       Graphics g = jg.image.getGraphics();

			       g.setColor(Color.WHITE);
			       g.fillRect(0, 0, width + 200, height + 200);
			       g.setColor(Color.BLACK);

			       int lbx = 20; int lby = 20;

			       // 绘制框
			       drawFrame(lbx, lby, width, height + 20, g);

			       // 绘制窗口
			       drawPanel(lbx + 60, lby + 60, g);

			       jg.createJpg(Constants.picInstancePath);
			     }
		   }

	   public class Output
			   {
		     public Output()
		     {
			     }

		//输出工单
		     public boolean OutputToPdfFile(String filepath)
		     {
			       Rectangle rectPageSize = new Rectangle(PageSize.A4);
			       Document doc = new Document(rectPageSize, 30.0F, 30.0F, 30.0F, 30.0F);
			       try
				       {
				         PdfWriter.getInstance(doc, new FileOutputStream(filepath));

				         doc.open();

				//头部 --
				         OutputTopContent(doc, rectPageSize);

				//基本信息 --
				         OutputWholeContent(doc, rectPageSize);

				//部件
				         OutputAllPartsContent(doc, rectPageSize);

				//面积 --
				         OutputTotalArea(doc, rectPageSize);

				         OutputComments(doc, rectPageSize);

				         doc.close();
				         return true;
				       }
			       catch (FileNotFoundException e)
				       {
				         JOptionPane.showMessageDialog(null, e, "错误", 0);
				         return false;
				       }
			       catch (DocumentException e)
				       {
				       }
			       return false;
			     }

		     private void OutputTopContent(Document doc, Rectangle rectPageSize)
		     {
			       try
				       {
				         BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", false);
				         Font FontChinese = new Font(bfChinese, 10.0F, 0);
				         Font FontChinese18 = new Font(bfChinese, 24.0F, 1);
				         PdfPTable table = new PdfPTable(3);
				         table.setWidthPercentage(100.0F);
				         float[] widths = { 0.4F, 0.4F, 0.2F };
				         table.setWidths(widths);

				         PdfPCell cell = new PdfPCell();
				         Paragraph para = new Paragraph();
				         para.add(new Chunk("制造单号: ", FontChinese));
				         para.add(new Chunk(m_OrderInfo.GetOrderIndex(), FontChinese18));
				         cell.addElement(para);
				         para = new Paragraph("");
				         cell.addElement(para);
				         Date orderDate = m_OrderInfo.GetOrderDate();
				         DateFormat dtformat = new SimpleDateFormat("yyyy年MM月dd日");
				         cell.addElement(new Paragraph(new Phrase("下单日期：" + dtformat.format(orderDate), FontChinese)));
				         Date dDate = new Date(m_OrderInfo.GetOrderDate().getTime() + 691200000L);
				         cell.addElement(new Paragraph("交货日期: " + dtformat.format(dDate), FontChinese));
				         table.addCell(cell);

				         String pipeIndex = m_OrderInfo.GetPipeIndex();
				         String windowIndex = m_OrderInfo.GetWindowIndex();
				         String windowNum = m_OrderInfo.GetWindowNum();
				         String singleWindowIndex = pipeIndex + "-" + windowIndex + "/" + windowNum;
				         cell = new PdfPCell();
				         cell.addElement(new Paragraph("制造厂： 欣成木业", FontChinese));
				         para = new Paragraph("");
				         cell.addElement(para);
				         para = new Paragraph();
				         para.add(new Chunk("单窗制造单: ", FontChinese));
				         Chunk tmp = new Chunk(singleWindowIndex, FontChinese18);
				         tmp.setTextRise(-8.0F);
				         para.add(tmp);
				         cell.addElement(para);
				         table.addCell(cell);

				         FontChinese = new Font(bfChinese, 10.0F, 0);
				         int year = Calendar.getInstance().get(1);
				         int month = Calendar.getInstance().get(2);
				         int date = Calendar.getInstance().get(5);
				         int hour = Calendar.getInstance().get(11);
				         int minute = Calendar.getInstance().get(12);
				         String dateprn = Integer.toString(year) + "-" + Integer.toString(month + 1) + "-" + Integer.toString(date);

				         cell = new PdfPCell();
				         cell.addElement(new Paragraph("打印日期 " + dateprn, FontChinese));
				         cell.addElement(new Paragraph("打印时间 " + Integer.toString(hour) + ":" + Integer.toString(minute), FontChinese));

				         table.addCell(cell);

				         doc.add(table);
				       }
			       catch (FileNotFoundException e) {
				         e.printStackTrace();
				       } catch (DocumentException e) {
				         e.printStackTrace();
				       } catch (IOException e) {
				         e.printStackTrace();
				       }
			     }

		     private void OutputWholeContent(Document doc, Rectangle rectPageSize)
		     {
			       try
				       {
				         BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", false);
				         Font FontChinese = new Font(bfChinese, 10.0F, 0);
				         PdfPTable outTable = new PdfPTable(2);
				         outTable.setWidthPercentage(100.0F);
				         float[] widths = { 0.5F, 0.5F };
				         outTable.setWidths(widths);

				         PdfPTable table = new PdfPTable(2);
				         table.setWidthPercentage(30.0F);
				         table.getDefaultCell().setBorder(0); // 不要边框
				         table.setHorizontalAlignment(Element.ALIGN_LEFT);

				         PdfPCell cell = new PdfPCell();
				         cell.addElement(new Paragraph("经销商(Dealer)", FontChinese));
				         table.addCell(cell);
				         cell = new PdfPCell();
				         String clientRegion = m_OrderInfo.GetClientRegion();
				         cell.addElement(new Paragraph(clientRegion, FontChinese));
				         table.addCell(cell);

				         cell = new PdfPCell();
				         cell.addElement(new Paragraph("客户标签(Customer)", FontChinese));
				         table.addCell(cell);
				         cell = new PdfPCell();
				         String custRefNum = m_OrderInfo.getCustRefNum();
				         cell.addElement(new Paragraph(custRefNum, FontChinese));
				         table.addCell(cell);

				         cell = new PdfPCell();
				         cell.addElement(new Paragraph("房间(Room)", FontChinese));
				         table.addCell(cell);
				         cell = new PdfPCell();
				         String room = m_OrderInfo.GetRoom();
				         cell.addElement(new Paragraph(room, FontChinese));
				         table.addCell(cell);

				         cell = new PdfPCell();
				         cell.addElement(new Paragraph("窗号(Line number)#", FontChinese));
				         table.addCell(cell);
				         cell = new PdfPCell();
				         String windowIndex = m_OrderInfo.GetWindowIndex();
				         cell.addElement(new Paragraph(windowIndex, FontChinese));
				         table.addCell(cell);

				         cell = new PdfPCell();
				         cell.addElement(new Paragraph("颜色(Color)", FontChinese));
				         table.addCell(cell);
				         cell = new PdfPCell();
				         String color = m_OrderInfo.GetColor();
				         cell.addElement(new Paragraph(color, FontChinese));
				         table.addCell(cell);

				         cell = new PdfPCell();
				         cell.addElement(new Paragraph("形状及安装方式", FontChinese));
				         cell.addElement(new Paragraph("(Shape and configuration)", FontChinese));
				         table.addCell(cell);
				         cell = new PdfPCell();
				         int frameType = m_OrderInfo.GetFrameType();
				         int woodOption = m_OrderInfo.GetWoodOption();
				         if (frameType != -1)
					         {
					           String frameDescription = Constants.FRAMECODE[frameType][woodOption];
					           cell.addElement(new Paragraph(frameDescription, FontChinese));
					         }
				         cell.addElement(new Paragraph("窗框里", FontChinese));
				         cell.addElement(new Paragraph(Constants.FRAMENUMPOS[m_OrderInfo.GetFrameNumPos()] + "(" + Constants.FRAMENUMPOS_EN[m_OrderInfo.GetFrameNumPos()].replaceAll("_", " ") + ")", FontChinese));

				         table.addCell(cell);

				         cell = new PdfPCell();
				         cell.addElement(new Paragraph("合页颜色(Color of hinge)", FontChinese));
				         table.addCell(cell);
				         cell = new PdfPCell();
				         int hingeColor = m_OrderInfo.GetHingeColor();
				         String strHingeColor = Constants.HINGECOLOR[hingeColor] + "(" + Constants.HINGECOLOR_EN[hingeColor].replaceAll("_", " ") + ")";

				         cell.addElement(new Paragraph(strHingeColor, FontChinese));
				         table.addCell(cell);

				         cell = new PdfPCell();
				         cell.addElement(new Paragraph("层数(Tiers)", FontChinese));
				         table.addCell(cell);
				         cell = new PdfPCell();
				         String level = m_OrderInfo.GetLevel();
				         cell.addElement(new Paragraph(level, FontChinese));
				         table.addCell(cell);

				         cell = new PdfPCell();
				         cell.addElement(new Paragraph("宽(Width)", FontChinese));
				         table.addCell(cell);
				         cell = new PdfPCell();
				         String oriWindowWidth = m_OrderInfo.GetOriWindowWidth();
				         cell.addElement(new Paragraph(oriWindowWidth, FontChinese));
				         table.addCell(cell);

				         cell = new PdfPCell();
				         cell.addElement(new Paragraph("高(Height)", FontChinese));
				         table.addCell(cell);
				         cell = new PdfPCell();
				         String oriWindowHeight = m_OrderInfo.GetOriWindowHeight();
				         cell.addElement(new Paragraph(oriWindowHeight, FontChinese));
				         table.addCell(cell);

				         if (m_OrderInfo.GetLevel().equals("1"))
					         {
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph("合页安装方式(Configuration)", FontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(m_OrderInfo.GetHingeInstallType(), FontChinese));
					           table.addCell(cell);
					         }
				         else if (m_OrderInfo.GetLevel().equals("2"))
					         {
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph("上层窗户合页安装方式", FontChinese));
					           cell.addElement(new Paragraph("(Top tier Configuration)", FontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(m_OrderInfo.GetHingeInstallType(), FontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph("下层窗户合页安装方式", FontChinese));
					           cell.addElement(new Paragraph("(Bottom tier Configuration)", FontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(m_OrderInfo.getBottomHingeInstallType(), FontChinese));
					           table.addCell(cell);
					         }

				         outTable.addCell(table);

				         cell = new PdfPCell();

				         // 设置显示图片 todo gxg 设置图片
				         Image jpeg = Image.getInstance(Constants.picInstancePath);
				         float picHeight = 0l;
				         float picWidth = 0l;
//				         float picHeight = jpeg.scaledHeight();
//				         float picWidth = jpeg.scaledWidth();
				         PdfPTable picTable = new PdfPTable(1);
				         if (picHeight > picWidth)
					         {
					           float percent = picWidth / picHeight * 100.0F;
					           picTable.setWidthPercentage(percent);
					         }
				         else
					         {
					           picTable.setWidthPercentage(100.0F);
					         }
				         picTable.getDefaultCell().setBorder(0);
				         picTable.addCell(jpeg);
				         cell.addElement(picTable);
				         outTable.addCell(cell);

				         doc.add(outTable);
				       }
			       catch (FileNotFoundException e)
				       {
				         e.printStackTrace();
				       } catch (DocumentException e) {
				         e.printStackTrace();
				       } catch (IOException e) {
				         e.printStackTrace();
				       }
			     }

		     private void OutputAllPartsContent(Document doc, Rectangle rectPageSize)
		     {
			       try
				       {
				         BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", false);
				         Font fontChinese = new Font(bfChinese, 10.0F, 0);
				         Font boldFontChinese = new Font(bfChinese, 10.0F, 1);
				         PdfPTable table = new PdfPTable(6);
				         table.setWidthPercentage(100.0F);
				         table.setHorizontalAlignment(0);
				         float[] widths = { 0.24F, 0.17F, 0.09F, 0.11F, 0.14F, 0.25F };
				         table.setWidths(widths);

				         PdfPCell cell = new PdfPCell();
				         cell.addElement(new Paragraph("部件", boldFontChinese));
				         cell.addElement(new Paragraph("(Components)", boldFontChinese));
				         table.addCell(cell);
				         cell = new PdfPCell();
				         cell.addElement(new Paragraph("部件代号", boldFontChinese));
				         cell.addElement(new Paragraph("(Components code)", boldFontChinese));
				         table.addCell(cell);
				         cell = new PdfPCell();
				         cell.addElement(new Paragraph("数量", boldFontChinese));
				         cell.addElement(new Paragraph("(Number)", boldFontChinese));
				         table.addCell(cell);
				         cell = new PdfPCell();
				         cell.addElement(new Paragraph("长(单位mm)", boldFontChinese));
				         cell.addElement(new Paragraph("(Length)", boldFontChinese));
				         table.addCell(cell);
				         cell = new PdfPCell();
				         cell.addElement(new Paragraph("宽/高(单位mm)", boldFontChinese));
				         cell.addElement(new Paragraph("(Width)", boldFontChinese));
				         table.addCell(cell);
				         cell = new PdfPCell();
				         cell.addElement(new Paragraph("备注", boldFontChinese));
				         cell.addElement(new Paragraph("(Remark)", boldFontChinese));
				         table.addCell(cell);

				         DecimalFormat nFormat = new DecimalFormat();
				         nFormat.setMaximumFractionDigits(2);
				         nFormat.setGroupingSize(10);

				         int frameWidthNum = m_OrderInfo.GetFrameWidthNum(); // 宽外框数量
				         int frameType = m_OrderInfo.GetFrameType(); // 外框类型
				         int woodOption = m_OrderInfo.GetWoodOption(); // 木材
				         String frameDescription = "";
				         if (frameType != -1) {
					           frameDescription = Constants.FRAMECODE[frameType][woodOption]; // 框描述
					         }

				         if (frameWidthNum > 0)
					         {
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph("框宽(Width of frame)", fontChinese)); // -----
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(frameDescription, fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(Integer.toString(frameWidthNum), fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           if (frameWidthNum == 0)
						           {
						             cell.addElement(new Paragraph("", fontChinese));
						           }
					           else
						           {
						             float frameWidth = winCalResult.getFrameWidth();
						             cell.addElement(new Paragraph(nFormat.format(frameWidth), fontChinese));
						           }
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					         }

				         int frameHeightNum = m_OrderInfo.GetFrameHeightNum(); // 框高数量
				         if (frameHeightNum > 0)
					         {
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph("框高(Height of frame)", fontChinese)); // ------
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(frameDescription, fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(Integer.toString(frameHeightNum), fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           if (frameHeightNum == 0)
						           {
						             cell.addElement(new Paragraph("", fontChinese));
						           }
					           else
						           {
						             float frameHeight = winCalResult.getFrameHeight();
						             cell.addElement(new Paragraph(nFormat.format(frameHeight), fontChinese));
						           }
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					         }

				         String tPoleType = m_OrderInfo.getTPoleType(); // T型立杆类型

				         String tPoleCode = "";
				         if (tPoleType.trim().equals(Constants.T_POLE_TYPE[0]))
					         {
					           tPoleCode = Constants.TPOLE_CODE[0];
					         }
				         else if (tPoleType.trim().equals(Constants.T_POLE_TYPE[1]))
					         {
					           tPoleCode = Constants.TPOLE_CODE[1];
					         }
				         else if (tPoleType.trim().equals(Constants.T_POLE_TYPE[2]))
					         {
					           tPoleCode = Constants.TPOLE_CODE[2];
					         }
							// 层数为2 且 有横T
				         if ((m_OrderInfo.GetLevel().trim().equals("2")) && (m_OrderInfo.getHTPoleExist()))
					         {
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph("横T", fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(tPoleCode, fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph("1", fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           String htPoleLen = nFormat.format(winCalResult.getHTPoleLength());
					           cell.addElement(new Paragraph(htPoleLen, fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph("", fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           if (m_OrderInfo.getSameHeight()) // 等高的情况
						           {
						             cell.addElement(new Paragraph("上下两层窗户等高。", fontChinese));
						           }
					           else
						           {
						             cell.addElement(new Paragraph("横T的位置为：" + m_OrderInfo.getHtPolePos() + "mm。", fontChinese));
						           }
					           table.addCell(cell);
					         }

				         int totalTenonNum = winCalResult.getTotaltenonNum();
				         if (totalTenonNum > 0)
					         {
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph("木榫", fontChinese)); 	// 不用计算
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph("WDDOWEL", fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           String strTenonNum = Integer.toString(totalTenonNum);
					           cell.addElement(new Paragraph(strTenonNum, fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					         }

				         int vaneBoltNum = winCalResult.getTotalVaneBolt();
				         if (vaneBoltNum > 0)
					         {
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph("叶片销", fontChinese)); // 不用计算
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph("PC1PIN", fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           String strVaneBoltNum = Integer.toString(vaneBoltNum);
					           cell.addElement(new Paragraph(strVaneBoltNum, fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					         }

				         int bendHingeNum = winCalResult.getTotalBendHingeNun();
				         if (bendHingeNum > 0)
					         {
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph("弯曲合页(Rebate hinge)", fontChinese)); // ------
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(Constants.HINGECODE[0], fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           String strHingeNum = Integer.toString(bendHingeNum);
					           cell.addElement(new Paragraph(strHingeNum, fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					         }

				         int singleHingeNum = winCalResult.getTotalSingleHingeNum();
				         if (singleHingeNum > 0)
					         {
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph("单开合页(Hinge)", fontChinese)); // ---------
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(Constants.HINGECODE[1], fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           String strHingeNum = Integer.toString(singleHingeNum);
					           cell.addElement(new Paragraph(strHingeNum, fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					         }

				         int doubleHingeNum = winCalResult.getTotalDoubleHingeNum();
				         if (doubleHingeNum > 0)
					         {
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph("双开合页", fontChinese)); // ----------
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(Constants.HINGECODE[2], fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           String strHingeNum = Integer.toString(doubleHingeNum);
					           cell.addElement(new Paragraph(strHingeNum, fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					         }

				         if (winCalResult.getMagnetNum() > 0)
					         {
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph("磁碰(Magnet)", fontChinese)); // -------
					           table.addCell(cell);
					           cell = new PdfPCell();
					           String megnetCode = ""; // 磁碰型号

					           if (m_OrderInfo.IsRoundMagnet())
						           {
						             megnetCode = Constants.PCMAG[1]; // 圆磁碰
						           }
					           else
						           {
						             megnetCode = Constants.PCMAG[0]; // 方磁碰
						           }
					           cell.addElement(new Paragraph(megnetCode, fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(Integer.toString(winCalResult.getMagnetNum()), fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					         }

				         int magnetSliceNum = winCalResult.getTotalMagnetSliceNum();
				         if (magnetSliceNum > 0)
					         {
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph("磁片", fontChinese)); // ------ todo 继续分析
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph("MAGNETSLICE", fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           String strNum = Integer.toString(magnetSliceNum);
					           cell.addElement(new Paragraph(strNum, fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					         }

				         int dobulePlasterNum = winCalResult.getDoublePlasterNum();
				         if (dobulePlasterNum > 0)
					         {
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph("双面胶(Double plaster)", fontChinese)); // 不处理
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph("DOUBLEPLASTER", fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           String strNum = Integer.toString(dobulePlasterNum);
					           cell.addElement(new Paragraph(strNum, fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					         }

				         cell = new PdfPCell();
				         cell.addElement(new Paragraph("立杆(Stile)", fontChinese)); // -----
				         table.addCell(cell);
				         cell = new PdfPCell();
				         String poleType = Constants.STILECODE[1][woodOption];
				         cell.addElement(new Paragraph(poleType, fontChinese));
				         table.addCell(cell);
				         cell = new PdfPCell();
				         int poleNum = Integer.parseInt(m_OrderInfo.GetPoleNum());
				         cell.addElement(new Paragraph(Integer.toString(poleNum), fontChinese));
				         table.addCell(cell);
				         cell = new PdfPCell();
				         float poleLength = winCalResult.getLeveInfo()[0].getPoleLength();
				         cell.addElement(new Paragraph(nFormat.format(poleLength), fontChinese));
				         table.addCell(cell);
				         cell = new PdfPCell();
				         cell.addElement(new Paragraph(""));
				         table.addCell(cell);
				         cell = new PdfPCell();
				         cell.addElement(new Paragraph(""));
				         table.addCell(cell);

				         // 对口立杆数量
				         int duikouPoleNum = Integer.parseInt(m_OrderInfo.GetDuiKouPoleNum());
				         if (duikouPoleNum > 0)
					         {
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph("对口立杆(Rebate stile)", fontChinese)); // ------
					           table.addCell(cell);
					           cell = new PdfPCell();
					           String duikouPoleType = Constants.STILECODE[0][woodOption];
					           cell.addElement(new Paragraph(duikouPoleType, fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(Integer.toString(duikouPoleNum), fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           float duikouPoleLength = winCalResult.getLeveInfo()[0].getDuiKouPoleLength();
					           cell.addElement(new Paragraph(nFormat.format(duikouPoleLength), fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					         }

					     // 双连立杆数
				         int shuangLianPoleNum = Integer.parseInt(m_OrderInfo.getShuangLianPoleNum());
				         if (shuangLianPoleNum > 0) {
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph("双连立杆(Connect stile)", fontChinese)); // -----
					           table.addCell(cell);
					           cell = new PdfPCell();
					           String shuangLianPoleType = Constants.STILECODE[2][woodOption];
					           cell.addElement(new Paragraph(shuangLianPoleType, fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(Integer.toString(shuangLianPoleNum), fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           float shuangLianPoleLen = winCalResult.getLeveInfo()[0].getShuangLianPoleLength();
					           cell.addElement(new Paragraph(nFormat.format(shuangLianPoleLen), fontChinese));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					         }

					         // T型立杆数量 不为空的情况
				         if (!CurtainChecker.isEmpty(m_OrderInfo.GetTPoleNum()))
					         {
					         	// T型立杆数量
					           int tPoleNum = Integer.parseInt(m_OrderInfo.GetTPoleNum());
					           if (tPoleNum > 0)
						           {
						           	// T型立杆位置
						             String tPolePos = m_OrderInfo.GetTPolePos();
						             String[] polesPos = tPolePos.split(",");
						             cell = new PdfPCell();
						             cell.addElement(new Paragraph("T型立杆", fontChinese)); // -----
						             table.addCell(cell);
						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(tPoleCode, fontChinese));
						             table.addCell(cell);
						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(Integer.toString(tPoleNum)));
						             table.addCell(cell);
						             cell = new PdfPCell();
						             // T型立杆长度
						             String tPoleLen = nFormat.format(winCalResult.getLeveInfo()[0].getTPoleLength());
						             cell.addElement(new Paragraph(tPoleLen, fontChinese));
						             table.addCell(cell);
						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(""));
						             table.addCell(cell);
						             cell = new PdfPCell();
						             String tPoleDesc = "";
						             // 窗扇等宽
						             if (m_OrderInfo.getSamePanelWidth())
							             {
							               tPoleDesc = "窗户等宽，T型立杆的位置可依据安装方式确定";
							             }
						             else
						             	// 非等宽情况
							             {
							               tPoleDesc = "从左至右，T型立杆的位置分别为：";
							               for (int i = 0; i < polesPos.length; i++)
								               {
								                 if (i == tPoleNum - 1)
									                 {
									                   tPoleDesc = tPoleDesc + polesPos[i] + "mm。";
									                 }
								                 else
									                 {
									                   tPoleDesc = tPoleDesc + polesPos[i] + "mm、";
									                 }
								               }
							             }
							             // 2层 && 没有T型立杆
						             if ((m_OrderInfo.GetLevel().trim().equals("2")) && (!m_OrderInfo.getHTPoleExist()))
							             {
							               tPoleDesc = tPoleDesc + "\r\n没有横T，立杆贯通上下两层。";
							             }
						             cell.addElement(new Paragraph(tPoleDesc, fontChinese));
						             table.addCell(cell);
						           }

					         }

				         String upBeamCode = ""; // 上横梁码
				         // 上横梁宽
				         float upBeamWidth = winCalResult.getLeveInfo()[0].getUpBeamWidth();
				         if (upBeamWidth <= 101.6F) {
					           upBeamCode = Constants.BEAMCODE[0][woodOption];
					         }
				         else if ((upBeamWidth > 101.6F) && (upBeamWidth <= 127.0F))
					         {
					           upBeamCode = Constants.BEAMCODE[1][woodOption];
					         }
				         else if ((upBeamWidth > 127.0F) && (upBeamWidth <= 152.39999F)) {
					           upBeamCode = Constants.BEAMCODE[2][woodOption];
					         }
				         String downBeamCode = ""; // 下横梁码
						   // 下横梁宽
				         float downBeamWidth = winCalResult.getLeveInfo()[0].getDownBeamWidth();
				         if (downBeamWidth <= 101.6F) {
					           downBeamCode = Constants.BEAMCODE[0][woodOption];
					         }
				         else if ((downBeamWidth > 101.6F) && (downBeamWidth <= 127.0F))
					         {
					           downBeamCode = Constants.BEAMCODE[1][woodOption];
					         }
				         else if ((downBeamWidth > 127.0F) && (downBeamWidth <= 152.39999F)) {
					           upBeamCode = Constants.BEAMCODE[2][woodOption];
					         }

				         String strVaneType = ""; // 叶片规格
				         int vaneType = m_OrderInfo.GetVaneType();
				         if (vaneType != -1)
					         {
					           strVaneType = Constants.VANECODE[vaneType][woodOption];
					         }

				         int dividerNum = 0;
				         if (!CurtainChecker.isEmpty(m_OrderInfo.GetDividerNum()))
					         {
					         	// 分隔梁数量
					           dividerNum = Integer.parseInt(m_OrderInfo.GetDividerNum());
					         }
				         int dividerType = m_OrderInfo.GetDividerType();
				         String dividerCode = "";
				         if (dividerNum > 0)
					         {
					           dividerCode = Constants.DIVIDERBEAMCODE[dividerType][woodOption];
					         }

					         // 扇等宽 || （T型立杆数量为空 || T型立杆数量为0 || T型立杆数量为-1）
				         if ((m_OrderInfo.getSamePanelWidth()) || (CurtainChecker.isEmpty(m_OrderInfo.GetTPoleNum())) || (m_OrderInfo.GetTPoleNum().trim().equals("0")) || (m_OrderInfo.GetTPoleNum().trim().equals("-1")))
					         {
					         	// 上下横梁宽度相等
					           if (upBeamWidth == downBeamWidth)
						           {
						             cell = new PdfPCell();
						             cell.addElement(new Paragraph("横梁(Rail)", fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(upBeamCode, fontChinese));
						             table.addCell(cell);

						             int beamNum = winCalResult.getLeveInfo()[0].getPaneNum() * 2;
						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(Integer.toString(beamNum), fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             float beamLen = winCalResult.getLeveInfo()[0].getDistInfo()[0].getUpBeamLength();
						             cell.addElement(new Paragraph(nFormat.format(beamLen), fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(nFormat.format(upBeamWidth), fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(""));
						             table.addCell(cell);
						           }
					           else      // 上下横梁宽度不相等
						           {
						             cell = new PdfPCell();
						             cell.addElement(new Paragraph("上横梁(Top rail)", fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(upBeamCode, fontChinese));
						             table.addCell(cell);

						             int beamNum = winCalResult.getLeveInfo()[0].getPaneNum();
						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(Integer.toString(beamNum), fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             float beamLen = winCalResult.getLeveInfo()[0].getDistInfo()[0].getUpBeamLength();
						             cell.addElement(new Paragraph(nFormat.format(beamLen), fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(nFormat.format(upBeamWidth), fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph("", fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph("下横梁(Bottom rail)", fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(downBeamCode, fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(Integer.toString(beamNum), fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(nFormat.format(beamLen), fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(nFormat.format(downBeamWidth), fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph("", fontChinese));
						             table.addCell(cell);
						           }

						           // 实木情况
					           if (m_OrderInfo.getIsBoard())
						           {
						             cell = new PdfPCell();
						             cell.addElement(new Paragraph("实木", fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph("BOARD", fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             int boardNum = winCalResult.getLeveInfo()[0].getPaneNum();
						             cell.addElement(new Paragraph(Integer.toString(boardNum), fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             float boardLen = winCalResult.getLeveInfo()[0].getDistInfo()[0].getBordLength();
						             cell.addElement(new Paragraph(nFormat.format(boardLen), fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             float boardWidth = winCalResult.getLeveInfo()[0].getDistInfo()[0].getBordWidth();
						             cell.addElement(new Paragraph(nFormat.format(boardWidth), fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(""));
						             table.addCell(cell);
						           }

						           // 非实木的情况
					           if (!m_OrderInfo.getIsBoard())
						           {
						             cell = new PdfPCell();
						             cell.addElement(new Paragraph("叶片(Louver)", fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(strVaneType, fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             int vaneNum = winCalResult.getLeveInfo()[0].getVaneNumPerPane() * winCalResult.getLeveInfo()[0].getPaneNum();
						             cell.addElement(new Paragraph(Integer.toString(vaneNum), fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             float vaneLen = winCalResult.getLeveInfo()[0].getDistInfo()[0].getVaneLength();
						             cell.addElement(new Paragraph(nFormat.format(vaneLen), fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(""));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(""));
						             table.addCell(cell);
						           }

						           // 分隔梁数量大于0 （相当于有中轨） && 不是实木
					           if ((dividerNum > 0) && (!m_OrderInfo.getIsBoard()))
						           {
						           	// 所有分隔梁数量
						             int allDividerNum = winCalResult.getLeveInfo()[0].getPaneNum() * dividerNum;
						             // 分隔梁长度
						             float dividerLen = winCalResult.getLeveInfo()[0].getDistInfo()[0].getDividerLength();

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph("分隔梁(Divider rail)", fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(dividerCode, fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(Integer.toString(allDividerNum), fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(nFormat.format(dividerLen), fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(""));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             String dividerDesc = "";
						             int tempVaneNum = 0;
						             for (int i = 0; i < dividerNum; i++) {
							               tempVaneNum += winCalResult.getLeveInfo()[0].getDividerPos()[i];
							               dividerDesc = "/" + Integer.toString(winCalResult.getLeveInfo()[0].getDividerPos()[i]) + dividerDesc;
							             }
						             int leftVaneNum = winCalResult.getLeveInfo()[0].getVaneNumPerPane() - tempVaneNum;
						             dividerDesc = "分隔梁的位置为(Divider rail's position)：" + Integer.toString(leftVaneNum) + dividerDesc;

						             cell.addElement(new Paragraph(dividerDesc, fontChinese));
						             table.addCell(cell);
						           }

					         }
				         else
					         {
					           char distOrder = 'A';
					           DistinctCalResultInfo[] topLevelDist = winCalResult.getLeveInfo()[0].getDistInfo();

					           String beamName = "横梁(Rail)";
					           String upBeamName = "上横梁(Top rail)";
					           String downBeamName = "下横梁(Bottom rail)";
					           String vaneName = "叶片(Louver)";
					           String dividerName = "分隔梁(Divider rail)";
					           int distVaneNum = 0;
					           int distDividerNum = 0;
					           int distPanelNum = 0;
					           float upBeamLen = 0.0F;
					           float downBeamLen = 0.0F;
					           float vaneLen = 0.0F;
					           float dividerLen = 0.0F;
					           // 上下梁宽度相当
					           if (upBeamWidth == downBeamWidth)
						           {
						             int i = 0;
						             for (int j = topLevelDist.length; i < j; i++)
							             {
							               distPanelNum = topLevelDist[i].getDistPaneNum();

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(beamName + distOrder, fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(upBeamCode, fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(Integer.toString(distPanelNum * 2), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               upBeamLen = topLevelDist[i].getUpBeamLength();
							               cell.addElement(new Paragraph(nFormat.format(upBeamLen), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(nFormat.format(upBeamWidth), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(""));
							               table.addCell(cell);

							               distOrder = (char)(distOrder + '\001');
							             }

						           }
					           else
						           {
						             int i = 0;
						             for (int j = topLevelDist.length; i < j; i++)
							             {
							               distPanelNum = topLevelDist[i].getDistPaneNum();

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(upBeamName + distOrder, fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(upBeamCode, fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(Integer.toString(distPanelNum), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               upBeamLen = topLevelDist[i].getUpBeamLength();
							               cell.addElement(new Paragraph(nFormat.format(upBeamLen), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(nFormat.format(upBeamWidth), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(""));
							               table.addCell(cell);

							               distOrder = (char)(distOrder + '\001');
							             }
						             distOrder = 'A';

						             int _i = 0;
						             for (int j = topLevelDist.length; _i < j; _i++)
							             {
							               distPanelNum = topLevelDist[_i].getDistPaneNum();

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(downBeamName + distOrder, fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(downBeamCode, fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(Integer.toString(distPanelNum), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               downBeamLen = topLevelDist[_i].getDownBeamLength();
							               cell.addElement(new Paragraph(nFormat.format(downBeamLen), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(nFormat.format(downBeamWidth), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(""));
							               table.addCell(cell);
							               distOrder = (char)(distOrder + '\001');
							             }
						           }

					           distOrder = 'A';
					           float boardLen = 0.0F;
					           float boardWidth = 0.0F;
					           int i = 0;
					           // 实木的情况
					           for (int j = topLevelDist.length; (i < j) && (m_OrderInfo.getIsBoard()); i++)
						           {
						             distPanelNum = topLevelDist[i].getDistPaneNum();

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph("实木" + distOrder, fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph("BOARD", fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(Integer.toString(distPanelNum), fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             boardLen = topLevelDist[i].getBordLength();
						             cell.addElement(new Paragraph(nFormat.format(boardLen), fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             boardWidth = topLevelDist[i].getBordWidth();
						             cell.addElement(new Paragraph(nFormat.format(boardWidth), fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(""));
						             table.addCell(cell);
						             distOrder = (char)(distOrder + '\001');
						           }
					           distOrder = 'A';

					           // 非实木的情况
					           int i1 = 0;
					           for (int j = topLevelDist.length; (i1 < j) && (!m_OrderInfo.getIsBoard()); i1++)
						           {
						             distPanelNum = topLevelDist[i1].getDistPaneNum();

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(vaneName + distOrder, fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(strVaneType, fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             distVaneNum = winCalResult.getLeveInfo()[0].getVaneNumPerPane() * distPanelNum;
						             cell.addElement(new Paragraph(Integer.toString(distVaneNum), fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             vaneLen = topLevelDist[i1].getVaneLength();
						             cell.addElement(new Paragraph(nFormat.format(vaneLen), fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(""));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(""));
						             table.addCell(cell);
						             distOrder = (char)(distOrder + '\001');
						           }
					           distOrder = 'A';

					           // 非实木的情况
					           int i2 = 0;
					           for (int j = topLevelDist.length; (i2 < j) && (!m_OrderInfo.getIsBoard()); i2++)
						           {
						             if (dividerNum <= 0)
							               continue;
						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(dividerName + distOrder, fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(dividerCode, fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             distDividerNum = Integer.parseInt(m_OrderInfo.GetDividerNum()) * distPanelNum;
						             cell.addElement(new Paragraph(Integer.toString(distDividerNum), fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             dividerLen = topLevelDist[i2].getDividerLength();
						             cell.addElement(new Paragraph(nFormat.format(dividerLen), fontChinese));
						             table.addCell(cell);

						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(""));
						             table.addCell(cell);

						             cell = new PdfPCell();

						             String dividerDesc = "";
						             int tempVaneNum = 0;
						             for (int m = 0; m < dividerNum; m++) {
							               tempVaneNum += winCalResult.getLeveInfo()[0].getDividerPos()[m];
							               dividerDesc = "/" + Integer.toString(winCalResult.getLeveInfo()[0].getDividerPos()[m]) + dividerDesc;
							             }
						             int leftVaneNum = winCalResult.getLeveInfo()[0].getVaneNumPerPane() - tempVaneNum;
						             dividerDesc = "分隔梁的位置为(Divider rail's position)：" + Integer.toString(leftVaneNum) + dividerDesc;
						             cell.addElement(new Paragraph(dividerDesc, fontChinese));
						             table.addCell(cell);
						             distOrder = (char)(distOrder + '\001');
						           }

					         }

				         int loop = 0;
				         String pullBarDesc = "";   // 拉杆描述
						   // 不是实木的情况
				         if (!m_OrderInfo.getIsBoard())
					         {
					           String strPullBarType = "";
					           int pullBarType = m_OrderInfo.GetPullBarType();
					           if ((pullBarType == 0) || (pullBarType == 2))
						           {
						             strPullBarType = Constants.PULLBAR[woodOption];
						           }
					           else
						           {
						             strPullBarType = Constants.ALUMBAR[vaneType];
						           }
					           float[] pullBarLength = winCalResult.getLeveInfo()[0].getPullBarLength();
					           do {
						             cell = new PdfPCell();
						             cell.addElement(new Paragraph("拉杆(Tilt rod)" + Integer.toString(loop + 1), fontChinese));
						             table.addCell(cell);
						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(strPullBarType, fontChinese));
						             table.addCell(cell);
						             cell = new PdfPCell();
						             // 拉杆数量 = 窗扇数量 * 每层拉杆数量
						             int pullBarNum = Integer.parseInt(m_OrderInfo.GetPanelNum()) * winCalResult.getLeveInfo()[0].getPullBarNumPerLevel()[dividerNum];

						             cell.addElement(new Paragraph(Integer.toString(pullBarNum), fontChinese));
						             table.addCell(cell);
						             cell = new PdfPCell();

						             cell.addElement(new Paragraph(nFormat.format(pullBarLength[loop]), fontChinese));
						             table.addCell(cell);
						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(""));
						             table.addCell(cell);

						             if (winCalResult.getLeveInfo()[0].getPullBarNumPerLevel()[dividerNum] == 2)
							             {
							               pullBarDesc = "该部分的隐式拉杆≥2300mm，被自动分为两段。";
							             }
						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(pullBarDesc, fontChinese));
						             table.addCell(cell);

						             loop++;
						           }
					           while (loop <= dividerNum);
					         }

					         // todo gxg 注意 整个下面的都是处理两层的情况！！！！
				         if (m_OrderInfo.GetLevel().trim().equals("2"))
					         {
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph("(下层)立杆(Stile)", fontChinese));
					           table.addCell(cell);

					           cell = new PdfPCell();
					           poleType = Constants.STILECODE[1][woodOption];  // 根据木材选择确定立杆类型
					           cell.addElement(new Paragraph(poleType, fontChinese));
					           table.addCell(cell);

					           cell = new PdfPCell();
					           poleNum = Integer.parseInt(m_OrderInfo.getBottomPoleNum()); // 下层立杆数量
					           cell.addElement(new Paragraph(Integer.toString(poleNum), fontChinese));
					           table.addCell(cell);

					           cell = new PdfPCell();
					           poleLength = winCalResult.getLeveInfo()[1].getPoleLength();  // 立杆长度
					           cell.addElement(new Paragraph(nFormat.format(poleLength), fontChinese));
					           table.addCell(cell);

					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);
					           cell = new PdfPCell();
					           cell.addElement(new Paragraph(""));
					           table.addCell(cell);

					           // 对口立杆数量
					           duikouPoleNum = Integer.parseInt(m_OrderInfo.getBottomDuiKouPoleNum());
					           if (duikouPoleNum > 0) {
						             cell = new PdfPCell();
						             cell.addElement(new Paragraph("(下层)对口立杆(Rebate stile)", fontChinese));
						             table.addCell(cell);
						             cell = new PdfPCell();
						             String duikouPoleType = Constants.STILECODE[0][woodOption];
						             cell.addElement(new Paragraph(duikouPoleType, fontChinese));
						             table.addCell(cell);
						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(Integer.toString(duikouPoleNum), fontChinese));
						             table.addCell(cell);
						             cell = new PdfPCell();
						             float duikouPoleLength = winCalResult.getLeveInfo()[1].getDuiKouPoleLength();
						             cell.addElement(new Paragraph(nFormat.format(duikouPoleLength), fontChinese));
						             table.addCell(cell);
						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(""));
						             table.addCell(cell);
						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(""));
						             table.addCell(cell);
						           }

						        // 下层双连立杆数量
					           shuangLianPoleNum = Integer.parseInt(m_OrderInfo.getBottomShuangLianPoleNum());
					           if (shuangLianPoleNum > 0) {
						             cell = new PdfPCell();
						             cell.addElement(new Paragraph("(下层)双连立杆(Connect stile)", fontChinese));
						             table.addCell(cell);
						             cell = new PdfPCell();
						             String shuangLianPoleType = Constants.STILECODE[2][woodOption];
						             cell.addElement(new Paragraph(shuangLianPoleType, fontChinese));
						             table.addCell(cell);
						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(Integer.toString(shuangLianPoleNum), fontChinese));
						             table.addCell(cell);
						             cell = new PdfPCell();
						             // 双连立杆长度
						             float shuangLianPoleLen = winCalResult.getLeveInfo()[1].getShuangLianPoleLength();
						             cell.addElement(new Paragraph(nFormat.format(shuangLianPoleLen), fontChinese));
						             table.addCell(cell);
						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(""));
						             table.addCell(cell);
						             cell = new PdfPCell();
						             cell.addElement(new Paragraph(""));
						             table.addCell(cell);
						           }

						           // 下层T型立杆数量不为空 && 有横T
					           if ((!CurtainChecker.isEmpty(m_OrderInfo.getBottomTPoleNum())) && (m_OrderInfo.getHTPoleExist()))
						           {
						           	// 下层T型立杆数量
						             int tPoleNum = Integer.parseInt(m_OrderInfo.getBottomTPoleNum());
						             if (tPoleNum > 0)
							             {
							               String tPolePos = m_OrderInfo.getBottomTPolePos();
							               String[] polesPos = tPolePos.split(",");
							               cell = new PdfPCell();
							               cell.addElement(new Paragraph("(下层)T型立杆", fontChinese));
							               table.addCell(cell);
							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(tPoleCode, fontChinese));
							               table.addCell(cell);
							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(Integer.toString(tPoleNum)));
							               table.addCell(cell);
							               cell = new PdfPCell();
							               // T 型立杆长度
							               String tPoleLen = nFormat.format(winCalResult.getLeveInfo()[1].getTPoleLength());
							               cell.addElement(new Paragraph(tPoleLen, fontChinese));
							               table.addCell(cell);
							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(""));
							               table.addCell(cell);
							               cell = new PdfPCell();
							               String tPoleDesc = "";
							               // 下层窗宽度相同
							               if (m_OrderInfo.getBottomSameWidth())
								               {
								                 tPoleDesc = "窗户等宽，T型立杆的位置可依据安装方式确定";
								               }
							               else   // 下层窗宽度不同
								               {
								                 tPoleDesc = "从左至右，T型立杆的位置分别为：";
								                 for (int i = 0; i < tPoleNum; i++)
									                 {
									                   if (i == tPoleNum - 1)
										                   {
										                     tPoleDesc = tPoleDesc + polesPos[i] + "mm。";
										                   }
									                   else
										                   {
										                     tPoleDesc = tPoleDesc + polesPos[i] + "mm、";
										                   }
									                 }
								               }

							               cell.addElement(new Paragraph(tPoleDesc, fontChinese));
							               table.addCell(cell);
							             }

						           }

					           upBeamCode = ""; // 上横梁   根据上横梁宽度计算

								 // 上横梁宽度
					           upBeamWidth = winCalResult.getLeveInfo()[1].getUpBeamWidth();
					           if (upBeamWidth <= 101.6F) {
						             upBeamCode = Constants.BEAMCODE[0][woodOption];
						           }
					           else if ((upBeamWidth > 101.6F) && (upBeamWidth <= 127.0F))
						           {
						             upBeamCode = Constants.BEAMCODE[1][woodOption];
						           }
					           else if ((upBeamWidth > 127.0F) && (upBeamWidth <= 152.39999F)) {
						             upBeamCode = Constants.BEAMCODE[2][woodOption];
						           }

					           downBeamCode = ""; // 下横梁码 根据下横梁宽度计算
								 // 下横梁宽度
					           downBeamWidth = winCalResult.getLeveInfo()[1].getDownBeamWidth();
					           if (downBeamWidth <= 101.6F) {
						             downBeamCode = Constants.BEAMCODE[0][woodOption];
						           }
					           else if ((downBeamWidth > 101.6F) && (downBeamWidth <= 127.0F))
						           {
						             downBeamCode = Constants.BEAMCODE[1][woodOption];
						           }
					           else if ((downBeamWidth > 127.0F) && (downBeamWidth <= 152.39999F)) {
						             upBeamCode = Constants.BEAMCODE[2][woodOption];
						           }

						           // 分隔梁数量
					           dividerNum = 0;
					           if (!CurtainChecker.isEmpty(m_OrderInfo.getBottomDividerNum()))
						           {
						             dividerNum = Integer.parseInt(m_OrderInfo.getBottomDividerNum());
						           }
						           // 分隔梁类型
					           String dividerTypeStr = m_OrderInfo.getBottomDividerType();
					           int m = 0; for (int n = Constants.DIVIDERTYPE.length; m < n; m++)
						           {
						             if (!dividerTypeStr.trim().equals(Constants.DIVIDERTYPE[m]))
							               continue;
						             dividerType = m;
						             break;
						           }

					           if (dividerNum > 0)
						           {
						             dividerCode = Constants.DIVIDERBEAMCODE[dividerType][woodOption];
						           }

						           // （下层窗等宽 || 下层T型立杆数为空） || （下层T型立杆数量为0 || 下层T型立杆数量为-1）
					           if ((m_OrderInfo.getBottomSameWidth()) || (CurtainChecker.isEmpty(m_OrderInfo.getBottomTPoleNum())) || (m_OrderInfo.getBottomTPoleNum().trim().equals("0")) || (m_OrderInfo.getBottomTPoleNum().trim().equals("-1")))
						           {
						           	// 上下横梁等宽
						             if (upBeamWidth == downBeamWidth)
							             {
							               cell = new PdfPCell();
							               cell.addElement(new Paragraph("(下层)横梁(Rail)", fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(upBeamCode, fontChinese));
							               table.addCell(cell);
										   // 横梁数 = 窗扇数 * 2
							               int beamNum = winCalResult.getLeveInfo()[1].getPaneNum() * 2;
							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(Integer.toString(beamNum), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               // 横梁长度
							               float beamLen = winCalResult.getLeveInfo()[1].getDistInfo()[0].getUpBeamLength();
							               cell.addElement(new Paragraph(nFormat.format(beamLen), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               // 上层横梁宽度
							               cell.addElement(new Paragraph(nFormat.format(upBeamWidth), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(""));
							               table.addCell(cell);
							             }
						             else
							             {
							               cell = new PdfPCell();
							               cell.addElement(new Paragraph("(下层)上横梁(Top rail)", fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               // 上横梁编码
							               cell.addElement(new Paragraph(upBeamCode, fontChinese));
							               table.addCell(cell);

							               // 横梁数量 = 窗扇数量
							               int beamNum = winCalResult.getLeveInfo()[1].getPaneNum();
							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(Integer.toString(beamNum), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               // 横梁长度
							               float beamLen = winCalResult.getLeveInfo()[1].getDistInfo()[0].getUpBeamLength();
							               cell.addElement(new Paragraph(nFormat.format(beamLen), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               // 上横梁宽度
							               cell.addElement(new Paragraph(nFormat.format(upBeamWidth), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph("", fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph("(下层)下横梁(Bottom rail)", fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               // 下横梁码
							               cell.addElement(new Paragraph(downBeamCode, fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               // 横梁数量
							               cell.addElement(new Paragraph(Integer.toString(beamNum), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               // 横梁长度
							               cell.addElement(new Paragraph(nFormat.format(beamLen), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               // 下横梁宽度
							               cell.addElement(new Paragraph(nFormat.format(downBeamWidth), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph("", fontChinese));
							               table.addCell(cell);
							             }

							             // 下层实木的情况
						             if (m_OrderInfo.getBottomIsBoard())
							             {
							               cell = new PdfPCell();
							               cell.addElement(new Paragraph("(下层)实木", fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph("BOARD", fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               // 板数量 = 窗扇数量
							               int boardNum = winCalResult.getLeveInfo()[1].getPaneNum();
							               cell.addElement(new Paragraph(Integer.toString(boardNum), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               // 板长度
							               float boardLen = winCalResult.getLeveInfo()[1].getDistInfo()[0].getBordLength();
							               cell.addElement(new Paragraph(nFormat.format(boardLen), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               // 板宽度
							               float boardWidth = winCalResult.getLeveInfo()[1].getDistInfo()[0].getBordWidth();
							               cell.addElement(new Paragraph(nFormat.format(boardWidth), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(""));
							               table.addCell(cell);
							             }
									      // 不是实木的情况
						             if (!m_OrderInfo.getBottomIsBoard())
							             {
							               cell = new PdfPCell();
							               cell.addElement(new Paragraph("(下层)叶片(Louver)", fontChinese));
							               table.addCell(cell);

							               // 下层叶片类型
							               String bottomVaneTypeStr = m_OrderInfo.getBottomVaneType();
							               int bottomVaneType = -1;
							               // VANETYPE = { "63.50", "88.90", "114.30", "48.00", "31.00" };
							               if (bottomVaneTypeStr.equals(Constants.VANETYPE[0])) {
								                 bottomVaneType = 0;
								               }
							               else if (bottomVaneTypeStr.equals(Constants.VANETYPE[1])) {
								                 bottomVaneType = 1;
								               }
							               else if (bottomVaneTypeStr.equals(Constants.VANETYPE[2])) {
								                 bottomVaneType = 2;
								               }
							               else if (bottomVaneTypeStr.equals(Constants.VANETYPE[3])) {
								                 bottomVaneType = 3;
								               }
							               else if (bottomVaneTypeStr.equals(Constants.VANETYPE[4])) {
								                 bottomVaneType = 4;
								               }
								               // 下层叶片码
							               String bottomVaneCode = Constants.VANECODE[bottomVaneType][woodOption];
							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(bottomVaneCode, fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               // 叶片数量 = 每个窗扇叶片数量 * 窗扇数量
							               int vaneNum = winCalResult.getLeveInfo()[1].getVaneNumPerPane() * winCalResult.getLeveInfo()[1].getPaneNum();
							               cell.addElement(new Paragraph(Integer.toString(vaneNum), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               // 叶片长度
							               float vaneLen = winCalResult.getLeveInfo()[1].getDistInfo()[0].getVaneLength();
							               cell.addElement(new Paragraph(nFormat.format(vaneLen), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(""));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(""));
							               table.addCell(cell);
							             }

							             // 不是实木 && 分隔梁数量大于0
						             if ((!m_OrderInfo.getBottomIsBoard()) && (dividerNum > 0))
							             {
							             	// 分隔梁数量 = 窗扇数？
							               int distDividerNum = winCalResult.getLeveInfo()[1].getPaneNum();
							               // 分隔梁长度
							               float dividerLen = winCalResult.getLeveInfo()[1].getDistInfo()[0].getDividerLength();

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph("(下层)分隔梁(Divider rail)", fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               // 分隔梁编码
							               cell.addElement(new Paragraph(dividerCode, fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               // 分隔梁数量
							               cell.addElement(new Paragraph(Integer.toString(distDividerNum), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               // 分隔梁长度
							               cell.addElement(new Paragraph(nFormat.format(dividerLen), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(""));
							               table.addCell(cell);

							               cell = new PdfPCell();

							               String dividerDesc = "";  // 分隔梁描述
							               int tempVaneNum = 0;
							               for (int m1 = 0; m1 < dividerNum; m1++) {
								                 tempVaneNum += winCalResult.getLeveInfo()[1].getDividerPos()[m1];
								                 dividerDesc = "/" + Integer.toString(winCalResult.getLeveInfo()[0].getDividerPos()[m1]) + dividerDesc;
								               }
							               int leftVaneNum = winCalResult.getLeveInfo()[1].getVaneNumPerPane() - tempVaneNum;
							               dividerDesc = "分隔梁的位置为(Divider rail's position)：" + Integer.toString(leftVaneNum) + dividerDesc;
							               cell.addElement(new Paragraph(dividerDesc, fontChinese));
							               table.addCell(cell);
							             }

						           }
					           else
						           {
						             DistinctCalResultInfo[] bottomLevelDist = winCalResult.getLeveInfo()[1].getDistInfo();

						             String beamName = "(下层)横梁(Rail)";
						             String upBeamName = "(下层)上横梁(Top rail)";
						             String downBeamName = "(下层)下横梁(Bottom rail)";
						             String vaneName = "(下层)叶片(Louver)";
						             String dividerName = "(下层)分隔梁(Divider rail)";
						             int distVaneNum = 0;
						             int distDividerNum = 0;
						             int distPanelNum = 0;
						             float upBeamLen = 0.0F;
						             float downBeamLen = 0.0F;
						             float vaneLen = 0.0F;
						             float dividerLen = 0.0F;
						             char bDistOrder = 'A';
						             bDistOrder = (char)(bDistOrder + winCalResult.getLeveInfo()[0].getDistInfo().length);
						             if (upBeamWidth == downBeamWidth)
							             {
							               int i = 0; for (int j = bottomLevelDist.length; i < j; i++)
								               {
								                 distPanelNum = bottomLevelDist[i].getDistPaneNum();

								                 cell = new PdfPCell();
								                 cell.addElement(new Paragraph(beamName + bDistOrder, fontChinese));
								                 table.addCell(cell);

								                 cell = new PdfPCell();
								                 cell.addElement(new Paragraph(upBeamCode, fontChinese));
								                 table.addCell(cell);

								                 cell = new PdfPCell();
								                 cell.addElement(new Paragraph(Integer.toString(distPanelNum * 2), fontChinese));
								                 table.addCell(cell);

								                 cell = new PdfPCell();
								                 upBeamLen = bottomLevelDist[i].getUpBeamLength();
								                 cell.addElement(new Paragraph(nFormat.format(upBeamLen), fontChinese));
								                 table.addCell(cell);

								                 cell = new PdfPCell();
								                 cell.addElement(new Paragraph(nFormat.format(upBeamWidth), fontChinese));
								                 table.addCell(cell);

								                 cell = new PdfPCell();
								                 cell.addElement(new Paragraph("", fontChinese));
								                 table.addCell(cell);
								                 bDistOrder = (char)(bDistOrder + '\001');
								               }

							             }
						             else
							             {
							               int i = 0; for (int j = bottomLevelDist.length; i < j; i++)
								               {
								                 distPanelNum = bottomLevelDist[i].getDistPaneNum();

								                 cell = new PdfPCell();
								                 cell.addElement(new Paragraph(upBeamName + bDistOrder, fontChinese));
								                 table.addCell(cell);

								                 cell = new PdfPCell();
								                 cell.addElement(new Paragraph(upBeamCode, fontChinese));
								                 table.addCell(cell);

								                 cell = new PdfPCell();
								                 cell.addElement(new Paragraph(Integer.toString(distPanelNum), fontChinese));
								                 table.addCell(cell);

								                 cell = new PdfPCell();
								                 upBeamLen = bottomLevelDist[i].getUpBeamLength();
								                 cell.addElement(new Paragraph(nFormat.format(upBeamLen), fontChinese));
								                 table.addCell(cell);

								                 cell = new PdfPCell();
								                 cell.addElement(new Paragraph(nFormat.format(upBeamWidth), fontChinese));
								                 table.addCell(cell);

								                 cell = new PdfPCell();
								                 cell.addElement(new Paragraph(""));
								                 table.addCell(cell);
								                 bDistOrder = (char)(bDistOrder + '\001');
								               }
							               bDistOrder = 'A';
							               bDistOrder = (char)(bDistOrder + winCalResult.getLeveInfo()[0].getDistInfo().length);

							               int i1 = 0; for (int j = bottomLevelDist.length; i1 < j; i1++)
								               {
								                 distPanelNum = bottomLevelDist[i1].getDistPaneNum();

								                 cell = new PdfPCell();
								                 cell.addElement(new Paragraph(downBeamName + bDistOrder, fontChinese));
								                 table.addCell(cell);

								                 cell = new PdfPCell();
								                 cell.addElement(new Paragraph(downBeamCode, fontChinese));
								                 table.addCell(cell);

								                 cell = new PdfPCell();
								                 cell.addElement(new Paragraph(Integer.toString(distPanelNum), fontChinese));
								                 table.addCell(cell);

								                 cell = new PdfPCell();
								                 downBeamLen = bottomLevelDist[i1].getDownBeamLength();
								                 cell.addElement(new Paragraph(nFormat.format(downBeamLen), fontChinese));
								                 table.addCell(cell);

								                 cell = new PdfPCell();
								                 cell.addElement(new Paragraph(nFormat.format(downBeamWidth), fontChinese));
								                 table.addCell(cell);

								                 cell = new PdfPCell();
								                 cell.addElement(new Paragraph(""));
								                 table.addCell(cell);
								                 bDistOrder = (char)(bDistOrder + '\001');
								               }

							             }

						             bDistOrder = 'A';
						             bDistOrder = (char)(bDistOrder + winCalResult.getLeveInfo()[0].getDistInfo().length);
						             float boardLen = 0.0F;
						             float boardWidth = 0.0F;
						             int i = 0;
						             for (int j = bottomLevelDist.length; (i < j) && (m_OrderInfo.getBottomIsBoard()); i++)
							             {
							               distPanelNum = bottomLevelDist[i].getDistPaneNum();

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph("实木" + bDistOrder, fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph("BOARD", fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(Integer.toString(distPanelNum), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               boardLen = bottomLevelDist[i].getBordLength();
							               cell.addElement(new Paragraph(nFormat.format(boardLen), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               boardWidth = bottomLevelDist[i].getBordWidth();
							               cell.addElement(new Paragraph(nFormat.format(boardWidth), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(""));
							               table.addCell(cell);
							               bDistOrder = (char)(bDistOrder + '\001');
							             }
						             bDistOrder = 'A';
						             bDistOrder = (char)(bDistOrder + winCalResult.getLeveInfo()[0].getDistInfo().length);

						             String bottomVaneTypeStr = m_OrderInfo.getBottomVaneType();
						             int bottomVaneType = -1;
						             if (bottomVaneTypeStr.equals(Constants.VANETYPE[0])) {
							               bottomVaneType = 0;
							             }
						             else if (bottomVaneTypeStr.equals(Constants.VANETYPE[1])) {
							               bottomVaneType = 1;
							             }
						             else if (bottomVaneTypeStr.equals(Constants.VANETYPE[2])) {
							               bottomVaneType = 2;
							             }
						             else if (bottomVaneTypeStr.equals(Constants.VANETYPE[3])) {
							               bottomVaneType = 3;
							             }
						             else if (bottomVaneTypeStr.equals(Constants.VANETYPE[4])) {
							               bottomVaneType = 4;
							             }
						             String bottomVaneCode = Constants.VANECODE[bottomVaneType][woodOption];

						             int i1 = 0;
						             for (int j = bottomLevelDist.length; (i1 < j) && (!m_OrderInfo.getBottomIsBoard()); i1++)
							             {
							               distPanelNum = bottomLevelDist[i1].getDistPaneNum();

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(vaneName + bDistOrder, fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(bottomVaneCode, fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               distVaneNum = winCalResult.getLeveInfo()[1].getVaneNumPerPane() * distPanelNum;
							               cell.addElement(new Paragraph(Integer.toString(distVaneNum), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               vaneLen = bottomLevelDist[i1].getVaneLength();
							               cell.addElement(new Paragraph(nFormat.format(vaneLen), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(""));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(""));
							               table.addCell(cell);
							               bDistOrder = (char)(bDistOrder + '\001');
							             }
						             bDistOrder = 'A';
						             bDistOrder = (char)(bDistOrder + winCalResult.getLeveInfo()[0].getDistInfo().length);

						             int i2 = 0; for (int j = bottomLevelDist.length; (i2 < j) && (!m_OrderInfo.getBottomIsBoard()); i2++)
							             {
							               if (dividerNum <= 0)
								                 continue;
							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(dividerName + bDistOrder, fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(dividerCode, fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               distDividerNum = Integer.parseInt(m_OrderInfo.getBottomDividerNum()) * distPanelNum;
							               cell.addElement(new Paragraph(Integer.toString(distDividerNum), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               dividerLen = bottomLevelDist[i2].getDividerLength();
							               cell.addElement(new Paragraph(nFormat.format(dividerLen), fontChinese));
							               table.addCell(cell);

							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(""));
							               table.addCell(cell);

							               cell = new PdfPCell();

							               String dividerDesc = "";
							               int tempVaneNum = 0;
							               for (int m1 = 0; m1 < dividerNum; m1++) {
								                 tempVaneNum += winCalResult.getLeveInfo()[1].getDividerPos()[m1];
								                 dividerDesc = "/" + Integer.toString(winCalResult.getLeveInfo()[0].getDividerPos()[m1]) + dividerDesc;
								               }
							               int leftVaneNum = winCalResult.getLeveInfo()[1].getVaneNumPerPane() - tempVaneNum;
							               dividerDesc = "分隔梁的位置为(Divider rail's position)：" + Integer.toString(leftVaneNum) + dividerDesc;
							               cell.addElement(new Paragraph(dividerDesc, fontChinese));
							               table.addCell(cell);
							               bDistOrder = (char)(bDistOrder + '\001');
							             }

						           }

					           loop = 0;
					           if (!m_OrderInfo.getBottomIsBoard()) // 不是实木的情况
						           {
						             String strPullBarType = "";
						             // 拉杆类型
						             int pullBarType = m_OrderInfo.GetPullBarType();
						             if ((pullBarType == 0) || (pullBarType == 2) || (pullBarType == 3))
							             {
							               strPullBarType = Constants.PULLBAR[woodOption];
							             }
						             else
							             {
							               strPullBarType = Constants.ALUMBAR[vaneType];
							             }
						             dividerNum = 0;
						             if (!CurtainChecker.isEmpty(m_OrderInfo.getBottomDividerNum()))
							             {
							               dividerNum = Integer.parseInt(m_OrderInfo.getBottomDividerNum());
							             }
							             // 拉杆长度
						             float[] pullBarLength = winCalResult.getLeveInfo()[1].getPullBarLength();
						             do {
							               cell = new PdfPCell();
							               cell.addElement(new Paragraph("(下层)拉杆(Tilt rod)" + Integer.toString(loop + 1), fontChinese));
							               table.addCell(cell);
							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(strPullBarType, fontChinese));
							               table.addCell(cell);
							               cell = new PdfPCell();
							               // 拉杆数量
							               int pullBarNum = Integer.parseInt(m_OrderInfo.getBottomPanelNum());
							               cell.addElement(new Paragraph(Integer.toString(pullBarNum), fontChinese));
							               table.addCell(cell);
							               cell = new PdfPCell();

							               cell.addElement(new Paragraph(nFormat.format(pullBarLength[loop]), fontChinese));
							               table.addCell(cell);
							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(""));
							               table.addCell(cell);
							               cell = new PdfPCell();
							               cell.addElement(new Paragraph(""));
							               table.addCell(cell);

							               loop++;
							             }
						             while (loop <= dividerNum);
						           }

					         }

				         doc.add(table);
				       }
			       catch (FileNotFoundException e)
				       {
				       }
			       catch (DocumentException e)
				       {
				       }
			       catch (IOException e)
				       {
				       }
			     }

		     private void OutputTotalArea(Document doc, Rectangle rectPageSize)
		     {
			       try
				       {
				         BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", false);
				         Font FontChinese = new Font(bfChinese, 10.0F, 0);
				         PdfPTable table = new PdfPTable(1);
				         table.setWidthPercentage(100.0F);
				         table.setHorizontalAlignment(0);

				         NumberFormat nFormat = NumberFormat.getNumberInstance();
				         nFormat.setMaximumFractionDigits(2);

				         PdfPCell cell = new PdfPCell();
				         float totalArea = winCalResult.getTotalArea();
				         cell.addElement(new Paragraph("总计： 平方米: " + nFormat.format(totalArea / 1000000.0F) + " / " + nFormat.format(totalArea / 1000000.0F), FontChinese));

				         table.addCell(cell);

				         doc.add(table);
				       } catch (FileNotFoundException e) {
				         e.printStackTrace();
				       } catch (DocumentException e) {
				         e.printStackTrace();
				       } catch (IOException e) {
				         e.printStackTrace();
				       }
			     }

		     private void OutputComments(Document doc, Rectangle rectPageSize)
		     {
			       try
				       {
				         BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", false);
				         Font FontChinese = new Font(bfChinese, 10.0F, 0);
				         PdfPTable table = new PdfPTable(3);
				         String comments = m_OrderInfo.GetComments();
				         System.out.println("the comments are: " + comments);
				         if ((comments == null) || (comments.equals("")))
					         {
					           return;
					         }
				         doc.add(new Paragraph("备注", FontChinese));

				         String[] strComments = comments.split("@@");
				         int rowNum = strComments.length % (Constants.TABLESIZE[1] - 1) == 0 ? strComments.length / (Constants.TABLESIZE[1] - 1) : strComments.length / (Constants.TABLESIZE[1] - 1) + 1;

				         for (int i = 0; i < rowNum; i++)
					         {
					           for (int j = 0; j < Constants.TABLESIZE[1] - 1; j++)
						           {
						             if (i * (Constants.TABLESIZE[1] - 1) + j < strComments.length)
							             {
							               PdfPCell cell = new PdfPCell();
							               cell.addElement(new Paragraph(strComments[(i * (Constants.TABLESIZE[1] - 1) + j)], FontChinese));
							               table.addCell(cell);
							             }
						             else
							             {
							               PdfPCell cell = new PdfPCell();
							               cell.addElement(new Paragraph(""));
							               table.addCell(cell);
							             }
						           }
					         }
				         doc.add(table);
				       }
			       catch (FileNotFoundException e) {
				         e.printStackTrace();
				       } catch (DocumentException e) {
				         e.printStackTrace();
				       } catch (IOException e) {
				         e.printStackTrace();
				       }
			     }
		   }

	   public class CalculateRectSimple
			   {
		     private LevelCalResultInfo topLevelInfo = null; // 上层信息

		     private DistinctCalResultInfo[] topDistsInfo = null;

		     private LevelCalResultInfo bottomLevelInfo = null; // 下层信息

		     private DistinctCalResultInfo[] bottomDistsInfo = null;

		     public CalculateRectSimple()
		     {
			       this.topLevelInfo = winCalResult.getLeveInfo()[0];
			       this.topDistsInfo = this.topLevelInfo.getDistInfo();
			       if ((m_OrderInfo.GetLevel() != null) && (m_OrderInfo.GetLevel().equals("2")))
				       {
				         this.bottomLevelInfo = winCalResult.getLeveInfo()[1];
				         this.bottomDistsInfo = this.bottomLevelInfo.getDistInfo();
				       }
			     }


		//初始化工单数据（计算各个部件数据）
		     public boolean exec()
		     {
			       if (!checkHingeInstall())
				       {
				         return false;
				       }
			       if (!calFrameWidthAndHeight())//计算外框高度、宽度保存再 winCalResult 中
				       {
				         return false;
				       }
					winCalResult.setHTPoleLength(winCalResult.getFrameWidth());
			       calHTPoleLength();//计算横T长度 保存在winCalResult
			       calDoublePlasterNum();//双石膏？？setDoublePlasterNum (numOfHeight + numOfWidth) * baseNum * 2

			       if (calPoleLength())//Pole 杆？？ 上层杆 和 下层杆计算
				       {
				         calDuiKouPoleLength();//计算对口立杆
				         calShuangLianPoleLength();//计算双连立杆长度
				         calTPoleLength();//T型立杆长度
				       }
			       else
				       {
				         return false;
				       }

			       if (!calBeamRelatedLength())//横梁
				       {
				         return false;
				       }
			       autoAddDivider();//自动添加隔梁
			       calVaneNumAndBeamWidth();//叶片数 梁宽度？？
			       if (!calDividerPos()) // 计算分隔梁位置
				       {
				         return false;
				       }
			       calPullBarLength(); // 计算拉杆长度
			       calVaneBoltNumPerPane(); // 计算每扇窗叶片销数量
			       calTenonNumPerPane(); // 计算每扇窗木榫数量

			       this.topLevelInfo.calulateLevelRelatedParam(); // 计算层关联参数
			       if (m_OrderInfo.GetLevel().trim().equals("2"))
				       {
				         this.bottomLevelInfo.calulateLevelRelatedParam();
				       }

			       calMagnetNum(); // 计算磁片数量
			       calTotalArea(); // 计算面积

			       calMagnetSlice(); // 计算磁片

			       return true;
			     }

		     private boolean checkHingeInstall()
		     {
			       boolean isVaild = true;
			       if ((m_OrderInfo.GetLevel().trim().equals("2")) && (!m_OrderInfo.getHTPoleExist()))
				       {
				         if (!CurtainChecker.isEmpty(m_OrderInfo.GetTPoleNum()))
					         {
					           if ((CurtainChecker.isEmpty(m_OrderInfo.getBottomTPoleNum())) && (!m_OrderInfo.GetTPoleNum().trim().equals("0"))) {
						             JOptionPane.showMessageDialog(null, "没有横T，上下两层的T型立杆数量必须相同！", "错误", 0);
						             return false;
						           }
					           if ((!CurtainChecker.isEmpty(m_OrderInfo.getBottomTPoleNum())) && (!m_OrderInfo.GetTPoleNum().trim().equals(m_OrderInfo.getBottomTPoleNum())))
						           {
						             JOptionPane.showMessageDialog(null, "没有横T，上下两层的T型立杆数量必须相同！", "错误", 0);
						             return false;
						           }

					         }
				         else if ((!CurtainChecker.isEmpty(m_OrderInfo.getBottomTPoleNum())) && (!m_OrderInfo.getBottomTPoleNum().trim().equals("0")))
					         {
					           JOptionPane.showMessageDialog(null, "没有横T，上下两层的T型立杆数量必须相同！", "错误", 0);
					           return false;
					         }

				         if (!CurtainChecker.isEmpty(m_OrderInfo.GetTPolePos()))
					         {
					           if (CurtainChecker.isEmpty(m_OrderInfo.getBottomTPolePos()))
						           {
						             JOptionPane.showMessageDialog(null, "没有横T，上下两层的T型立杆位置必须一致！", "错误", 0);
						             return false;
						           }

					           if (!m_OrderInfo.GetTPolePos().trim().equals(m_OrderInfo.getBottomTPolePos().trim()))
						           {
						             JOptionPane.showMessageDialog(null, "没有横T，上下两层的T型立杆位置必须一致！", "错误", 0);
						             return false;
						           }

					         }
				         else if (!CurtainChecker.isEmpty(m_OrderInfo.getBottomTPolePos()))
					         {
					           JOptionPane.showMessageDialog(null, "没有横T立杆，上下两层的T型立杆位置必须一致！", "错误", 0);
					           return false;
					         }
				       }

			       return isVaild;
			     }


		/**
		 * 计算窗户高度宽度
		 * 根据 外框数量和位置的不同
		 * 宽度 = 原始宽度 - 二维数组[外框类型][]
		 * 高度 = 原始宽度 - 二维数组[外框类型][]
		 * @return winCalResult.setFrameHeight(winHeight);//外框高度
		 * winCalResult.setFrameWidth(winWidth);//外框宽度
		 */
		     private boolean calFrameWidthAndHeight()
		     {
			       float origWinWidth = Float.parseFloat(m_OrderInfo.GetOriWindowWidth());//窗户宽度
			       float origWinHeight = Float.parseFloat(m_OrderInfo.GetOriWindowHeight());//窗户高度
			       float winWidth = 0.0F; float winHeight = 0.0F;
			       boolean retcode = false;

			       int frameType = m_OrderInfo.GetFrameType();//外框类型
			       int frameNumPos = m_OrderInfo.GetFrameNumPos();//外框数量和位置

			       if (frameNumPos > Constants.FRAMENUMPOS.length)
				       {
				         JOptionPane.showMessageDialog(null, "系统外框错误，无法继续处理", "错误", 0);
				         return false;
				       }

			//外框数量和位置 == 0
			       if (frameNumPos == 0)
				       {
				//窗户宽度 = 窗户宽度 - FRAME_FOUR_INSIDE[外框类型][0]
				         winWidth = origWinWidth - Float.parseFloat(Constants.FRAME_FOUR_INSIDE[frameType][0]);
				              //窗户高度 = 窗户高度 - 二维数组[外框类型][1]
				         winHeight = origWinHeight - Float.parseFloat(Constants.FRAME_FOUR_INSIDE[frameType][1]);

				         retcode = true;
				       }
			//外框数量和位置 == 1
			       else if (frameNumPos == 1)
				       {
				//窗户宽度 = 窗户宽度 - FRAME_FOUR_INSIDE_QIEDI[外框类型][0]
				         winWidth = origWinWidth - Float.parseFloat(Constants.FRAME_FOUR_INSIDE_QIEDI[frameType][0]);
				          //窗户高度 = 窗户高度 - FRAME_FOUR_INSIDE_QIEDI[外框类型][1]
				         winHeight = origWinHeight - Float.parseFloat(Constants.FRAME_FOUR_INSIDE_QIEDI[frameType][1]);

				         retcode = true;
				       }
			//外框数量和位置 == 2
			       else if (frameNumPos == 2)
				       {
				         winWidth = origWinWidth;//窗户宽度
				         winHeight = origWinHeight;//窗户高度
				         retcode = true;
				       }
			//外框数量和位置 == 3 || 4
			       else if ((frameNumPos == 3) || (frameNumPos == 4))
				       {
				//窗户宽度 = 窗户宽度 - FRAME_THREE_INSIDE[外框类型][0]
				         winWidth = origWinWidth - Float.parseFloat(Constants.FRAME_THREE_INSIDE[frameType][0]);

				         winHeight = origWinHeight - Float.parseFloat(Constants.FRAME_THREE_INSIDE[frameType][1]);

				         retcode = true;
				       }
			//外框数量和位置 == 5 || 6
			       else if ((frameNumPos == 5) || (frameNumPos == 6))
				       {
				//窗户宽度 = 窗户宽度 - FRAME_ONE_INSIDE[外框类型][0]
				         winWidth = origWinWidth - Float.parseFloat(Constants.FRAME_ONE_INSIDE[frameType][0]);
				          //窗户高度 = 原始窗户高度
				         winHeight = origWinHeight;
				         retcode = true;
				       }
			//外框数量和位置 == 7
			       else if (frameNumPos == 7)
				       {
				//窗户宽度 = 窗户宽度 - FRAME_TWO_INSIDE[外框类型][0]
				         winWidth = origWinWidth - Float.parseFloat(Constants.FRAME_TWO_INSIDE[frameType][0]);
				//窗户高度 = 原始窗户高度
				         winHeight = origWinHeight;
				         retcode = true;
				       }
			       else
				       {
				         JOptionPane.showMessageDialog(null, "系统暂不支持此种外框数，请重新输入", "错误", 0);
				       }
			       if (winHeight < 0.0F)
				       {
				         JOptionPane.showMessageDialog(null, "框高为负数，请重新设置原始框高！", "错误", 0);
				         retcode = false;
				       }
			       else if (winWidth < 0.0F)
				       {
				         JOptionPane.showMessageDialog(null, "框宽为负数，请重新设置原始框宽！", "错误", 0);
				         retcode = false;
				       }
			       winCalResult.setFrameHeight(winHeight);//外框高度

			       winCalResult.setFrameWidth(winWidth);//外框宽度

			       return retcode;
			     }

		//计算面积
		     private void calTotalArea()
		     {
			       float result = 0.0F;
			       String strTmp = m_OrderInfo.GetOriWindowWidth();
			       float origWinWidth = Float.parseFloat(strTmp);
			       String strOriWinHeight = m_OrderInfo.GetOriWindowHeight();
			       float origWinHeight = Float.parseFloat(strOriWinHeight);
			       int frameNumPos = m_OrderInfo.GetFrameNumPos();

			       int frameType = m_OrderInfo.GetFrameType();
			       float frameBrimSize = 0.0F;
			       if (frameType != -1)
				       {
				         frameBrimSize = Constants.FRAME_BRIM_SIZE[frameType];
				       }
			       if ((frameNumPos == 0) || (frameNumPos == 1))
				       {
				         result = (origWinWidth + frameBrimSize * 2.0F) * (origWinHeight + frameBrimSize * 2.0F);
				       }
			       else if (frameNumPos == 2)
				       {
				         result = origWinWidth * origWinHeight;
				       }
			       else if ((frameNumPos == 3) || (frameNumPos == 4))
				       {
				         result = (origWinWidth + frameBrimSize) * (origWinHeight + frameBrimSize * 2.0F);
				       }
			       else if ((frameNumPos == 5) || (frameNumPos == 6))
				       {
				         result = (origWinWidth + frameBrimSize) * origWinHeight;
				       }
			       else if (frameNumPos == 7)
				       {
				         result = (origWinWidth + frameBrimSize * 2.0F) * origWinHeight;
				       }
			       winCalResult.setTotalArea(result);
			     }

		     private void calDoublePlasterNum()
		     {
			       int type = m_OrderInfo.GetFrameType();//外框类型
			       int numOfHeight = 0;
			       int numOfWidth = 0;
			// 外框类型 大于等于10 小于等于14
			       if ((10 <= type) && (type <= 14))
				       {
				//窗户高度  > 1800.0F
				         if (winCalResult.getFrameHeight() > 1800.0F)
					         {
					           numOfHeight = 6;
					         }
				         else//窗户高度  < 1800.0F
					         {
					           numOfHeight = 3;
					         }
				          //窗户宽度  > 1800.0F
				         if (winCalResult.getFrameWidth() > 1800.0F)
					         {
					           numOfWidth = 6;
					         }
				         else//窗户宽度  < 1800.0F
					         {
					           numOfWidth = 3;
					         }

				         int baseNum = 1;
				         if (type == 10)//外框类型 = 10
					         {
					           baseNum = 2;
					         }
				          //DoublePlasterNum (numOfHeight + numOfWidth) * baseNum * 2
				         winCalResult.setDoublePlasterNum((numOfHeight + numOfWidth) * baseNum * 2);
				       }
			     }

		     private boolean calPoleLength()
		     {
			       int level = Integer.parseInt(m_OrderInfo.GetLevel());//层数
			       float poleLen = 0.0F;
			       if (level == 1)//层数 == 1层
				       {
				         poleLen = winCalResult.getFrameHeight() - 3.175F;//外框高度 - 3.175
				         this.topLevelInfo.setPoleLength(poleLen);//上层杆的长度
				       }
			       else if (level == 2)
				       {

				         boolean isSameHeight = m_OrderInfo.getSameHeight();

				         float tPoleHeight = 25.4F;
				          //两层 && 等高
				         if (isSameHeight)
					         {    //存在横T立杆
					           if (m_OrderInfo.getHTPoleExist())
						           {
						//两层 && 等高 && 存在横T立杆的情况下 (外框高度 - 25.4 - 6.35F) / 2
						             poleLen = (winCalResult.getFrameHeight() - tPoleHeight - 6.35F) / 2.0F;
						           }
					           else
						           {
						//两层 && 等高 && 不存在横T立杆的情况下 (外框高度 - 6.35) / 2
						             poleLen = (winCalResult.getFrameHeight() - 6.35F) / 2.0F;
						           }
					           this.topLevelInfo.setPoleLength(poleLen);//上层杆的长度
					           this.bottomLevelInfo.setPoleLength(poleLen);//下层杆的长度
					         }
				         else
					         {    //两层 && 不等高
					// 外框类型
					           int frameType = m_OrderInfo.GetFrameType();
					//外框数量和位置
					           int frameNumPos = m_OrderInfo.GetFrameNumPos();
					// 分隔线高度
					           float hTPolePos = Float.parseFloat(m_OrderInfo.getHtPolePos());
					           float bottomPoleLen = 0.0F;
					           float topPoleLen = 0.0F;
					               //两层 && 不等高 && 存在横T立杆
					           if (m_OrderInfo.getHTPoleExist())
						           {
						//外框数量和位置
						             if (frameNumPos == 0)
							             {
							             	bottomPoleLen = hTPolePos - Float.parseFloat(Constants.FRAME_FOUR_INSIDE[frameType][1]) / 2.0F - tPoleHeight / 2.0F - 3.175F;

							               topPoleLen = winCalResult.getFrameHeight() - (bottomPoleLen + tPoleHeight + 6.35F);
							             }
						             else if (frameNumPos == 1)
							             {
							             	bottomPoleLen = hTPolePos - Float.parseFloat(Constants.FRAME_FOUR_INSIDE_QIEDI[frameType][1]) / 2.0F - tPoleHeight / 2.0F - 3.175F;

							               topPoleLen = winCalResult.getFrameHeight() - (bottomPoleLen + tPoleHeight + 6.35F);
							             }
						             else if (frameNumPos == 2)
							             {
							               bottomPoleLen = hTPolePos - tPoleHeight / 2.0F - 3.175F;
							               topPoleLen = winCalResult.getFrameHeight() - (bottomPoleLen + tPoleHeight + 6.35F);
							             }
						             else if (frameNumPos == 3)
							             {
							               bottomPoleLen = hTPolePos - Float.parseFloat(Constants.FRAME_THREE_INSIDE[frameType][1]) - tPoleHeight / 2.0F - 3.175F;

							               topPoleLen = winCalResult.getFrameHeight() - (bottomPoleLen + tPoleHeight + 6.35F);
							             }
						             else if (frameNumPos == 4)
							             {
							               bottomPoleLen = hTPolePos - tPoleHeight / 2.0F - 3.175F;

							               topPoleLen = winCalResult.getFrameHeight() - (bottomPoleLen + tPoleHeight + 6.35F);
							             }
						             else if ((frameNumPos == 5) || (frameNumPos == 6))
							             {
							               bottomPoleLen = hTPolePos - tPoleHeight / 2.0F - 3.175F;

							               topPoleLen = winCalResult.getFrameHeight() - (bottomPoleLen + tPoleHeight + 6.35F);
							             }
						             else if (frameNumPos == 7)
							             {
							               bottomPoleLen = hTPolePos - tPoleHeight / 2.0F - 3.175F;
							               topPoleLen = winCalResult.getFrameHeight() - (bottomPoleLen + tPoleHeight + 6.35F);
							             }

						           }
					//两层 && 不等高 && 不存在横T立杆
					           else
						           {
						             if (frameNumPos == 0)
							             {
							               bottomPoleLen = hTPolePos - Float.parseFloat(Constants.FRAME_FOUR_INSIDE[frameType][1]) / 2.0F - 1.5875F - 3.175F;

							               topPoleLen = winCalResult.getFrameHeight() - (bottomPoleLen + 6.35F);
							             }

						             if (frameNumPos == 1)
							             {
							               bottomPoleLen = hTPolePos - Float.parseFloat(Constants.FRAME_FOUR_INSIDE_QIEDI[frameType][1]) / 2.0F - 1.5875F - 3.175F;

							               topPoleLen = winCalResult.getFrameHeight() - (bottomPoleLen + 6.35F);
							             }
						             else if (frameNumPos == 2)
							             {
							               bottomPoleLen = hTPolePos - 1.5875F - 3.175F;
							               topPoleLen = winCalResult.getFrameHeight() - (bottomPoleLen + 6.35F);
							             }
						             else if (frameNumPos == 3)
							             {
							               bottomPoleLen = hTPolePos - Float.parseFloat(Constants.FRAME_THREE_INSIDE[frameType][1]) - 1.5875F - 3.175F;

							               topPoleLen = winCalResult.getFrameHeight() - (bottomPoleLen + 6.35F);
							             }
						             else if (frameNumPos == 4)
							             {
							               bottomPoleLen = hTPolePos - 1.5875F - 3.175F;
							               topPoleLen = winCalResult.getFrameHeight() - (bottomPoleLen + 6.35F);
							             }
						             else if ((frameNumPos == 5) || (frameNumPos == 6))
							             {
							               bottomPoleLen = hTPolePos - 1.5875F - 3.175F;
							               topPoleLen = winCalResult.getFrameHeight() - (bottomPoleLen + 6.35F);
							             }
						             else if (frameNumPos == 7)
							             {
							               bottomPoleLen = hTPolePos - 1.5875F - 3.175F;
							               topPoleLen = winCalResult.getFrameHeight() - (bottomPoleLen + 6.35F);
							             }

						           }

					           this.topLevelInfo.setPoleLength(topPoleLen);//上层杆的长度
					           this.bottomLevelInfo.setPoleLength(bottomPoleLen);//下层杆的长度
					         }

				       }
			       else
				       {
				         JOptionPane.showMessageDialog(null, "系统不能处理大于2层普通方形！", "错误", 0);
				         return false;
				       }

			       return true;
			     }

		     private void calDuiKouPoleLength()
		     {
			       int level = Integer.parseInt(m_OrderInfo.GetLevel());
			       if (level == 1)
				       {
				         if ((!CurtainChecker.isEmpty(m_OrderInfo.GetDuiKouPoleNum())) && (Integer.parseInt(m_OrderInfo.GetDuiKouPoleNum()) > 0))
					         {
					           this.topLevelInfo.setDuiKouPoleLength(this.topLevelInfo.getPoleLength());
					         }

				       }
			       else if (level == 2)
				       {
				         if ((!CurtainChecker.isEmpty(m_OrderInfo.GetDuiKouPoleNum())) && (Integer.parseInt(m_OrderInfo.GetDuiKouPoleNum()) > 0))
					         {
					           this.topLevelInfo.setDuiKouPoleLength(this.topLevelInfo.getPoleLength());
					         }

				         if ((!CurtainChecker.isEmpty(m_OrderInfo.getBottomDuiKouPoleNum())) && (Integer.parseInt(m_OrderInfo.getBottomDuiKouPoleNum()) > 0))
					         {
					           this.bottomLevelInfo.setDuiKouPoleLength(this.bottomLevelInfo.getPoleLength());
					         }
				       }
			     }

		     private void calShuangLianPoleLength()
		     {
			       int level = Integer.parseInt(m_OrderInfo.GetLevel());
			       if (level == 1)
				       {
				         if ((!CurtainChecker.isEmpty(m_OrderInfo.getShuangLianPoleNum())) && (Integer.parseInt(m_OrderInfo.getShuangLianPoleNum()) > 0))
					         {
					           this.topLevelInfo.setShuangLianPoleLength(this.topLevelInfo.getPoleLength());
					         }

				       }
			       else if (level == 2)
				       {
				         if ((!CurtainChecker.isEmpty(m_OrderInfo.getShuangLianPoleNum())) && (Integer.parseInt(m_OrderInfo.getShuangLianPoleNum()) > 0))
					         {
					           this.topLevelInfo.setShuangLianPoleLength(this.topLevelInfo.getPoleLength());
					         }

				         if ((!CurtainChecker.isEmpty(m_OrderInfo.getBottomShuangLianPoleNum())) && (Integer.parseInt(m_OrderInfo.getBottomShuangLianPoleNum()) > 0))
					         {
					           this.bottomLevelInfo.setShuangLianPoleLength(this.bottomLevelInfo.getPoleLength());
					         }
				       }
			     }

		     private void calHTPoleLength()
		     {
			//orderInfo 层级 = 2 && HTPoleExist = true (横T存在)
			       if ((m_OrderInfo.GetLevel().trim().equals("2")) && (m_OrderInfo.getHTPoleExist()))
				       {
				//winCalResult.setHTPoleLength = winCalResult.getFrameWidth
				         winCalResult.setHTPoleLength(winCalResult.getFrameWidth());
				       }
			     }

		     private void calTPoleLength()
		     {
			       int level = Integer.parseInt(m_OrderInfo.GetLevel());
			       if (level == 1)
				       {
				         if ((!CurtainChecker.isEmpty(m_OrderInfo.GetTPoleNum())) && (Integer.parseInt(m_OrderInfo.GetTPoleNum()) > 0))
					         {
					           this.topLevelInfo.setTPoleLength(winCalResult.getFrameHeight());
					         }

				       }
			       else if (level == 2)
				       {
				         if (m_OrderInfo.getHTPoleExist())
					         {
					           if ((!CurtainChecker.isEmpty(m_OrderInfo.GetTPoleNum())) && (Integer.parseInt(m_OrderInfo.GetTPoleNum()) > 0))
						           {
						             this.topLevelInfo.setTPoleLength(this.topLevelInfo.getPoleLength() + 3.175F);
						           }

					           if ((!CurtainChecker.isEmpty(m_OrderInfo.getBottomTPoleNum())) && (Integer.parseInt(m_OrderInfo.getBottomTPoleNum()) > 0))
						           {
						             this.bottomLevelInfo.setTPoleLength(this.bottomLevelInfo.getPoleLength() + 3.175F);
						           }

					         }
				         else if ((!CurtainChecker.isEmpty(m_OrderInfo.GetTPoleNum())) && (Integer.parseInt(m_OrderInfo.GetTPoleNum()) > 0))
					         {
					           this.topLevelInfo.setTPoleLength(winCalResult.getFrameHeight());
					         }
				       }
			     }

		     private void calMagnetNum()
		     {
		     	   // 层数
			       int level = Integer.parseInt(m_OrderInfo.GetLevel());
			       // 窗扇数量
			       int panelNum = Integer.parseInt(m_OrderInfo.GetPanelNum());

			       int magnetNumPerPanel = 1;
			       // 第一层
			       if (level == 1)
				       {
				       	// 根据外框数量和位置 每个Panel上的 磁碰 个数不一样
						   // 外框数量
						   //  public static final String[] FRAMENUMPOS = { "四框，不切底", "四框，切底", "无框", "无下框", "无上框", "左框高", "右框高", "无上下框" };
				         int frameNum = m_OrderInfo.GetFrameNumPos();
				          // 四框，不切底 || 四框，切底
				         if ((frameNum == 0) || (frameNum == 1))
					         {
					           magnetNumPerPanel = 2;
					         }
					         // 无框
				         else if (frameNum == 2)
					         {
					           magnetNumPerPanel = 0;
					         }
					         // 无下框 || 无上框
				         else if ((frameNum == 3) || (frameNum == 4))
					         {
					           magnetNumPerPanel = 1;
					         }
					         // 左框高 || 无上下框
				         else if ((frameNum == 5) || (frameNum == 7))
					         {
					           magnetNumPerPanel = 0;
					         }
					         // 无上下框
				         else if (frameNum == 7)
					         {
					           magnetNumPerPanel = 0;
					         }

				       }
				       // 第二层
			       else if (level == 2)
				       {
				         if (m_OrderInfo.getHTPoleExist())
					         {
					           magnetNumPerPanel *= 2;
					         }
				         panelNum += Integer.parseInt(m_OrderInfo.getBottomPanelNum());
				       }
				       // 扇数 * 每个扇上的磁碰数量
			       winCalResult.setMagnetNum(panelNum * magnetNumPerPanel);
			     }

		     private boolean calBeamRelatedLength()
		     {
			       int level = new Integer(m_OrderInfo.GetLevel()).intValue();
			       boolean sameWidth = m_OrderInfo.getSamePanelWidth();
			       float frameWidth = winCalResult.getFrameWidth();
			       String tPolesPos = m_OrderInfo.GetTPolePos();//T型立杆位置
			       String oriWidth = CurtainDesign.m_UserMainGUI.GetOrderInfo().GetOriWindowWidth();
			       HingeRelatedInfo hingeInfo = null;

			       if ((sameWidth) || (CurtainChecker.isEmpty(tPolesPos)))
				       {
				         int tPoleNum = 0;
				         if (!CurtainChecker.isEmpty(m_OrderInfo.GetTPoleNum()))
					         {
					           tPoleNum = Integer.parseInt(m_OrderInfo.GetTPoleNum());
					         }
				         int poleNum = 0;
				         if (!CurtainChecker.isEmpty(m_OrderInfo.GetPoleNum()))
					         {
					           poleNum = Integer.parseInt(m_OrderInfo.GetPoleNum());
					         }
				         int duiKouPoleNum = 0;
				         if (!CurtainChecker.isEmpty(m_OrderInfo.GetDuiKouPoleNum()))
					         {
					           duiKouPoleNum = Integer.parseInt(m_OrderInfo.GetDuiKouPoleNum());
					         }
				         int shuangLianPoelNum = 0;
				         if (!CurtainChecker.isEmpty(m_OrderInfo.getShuangLianPoleNum()))
					         {
					           shuangLianPoelNum = Integer.parseInt(m_OrderInfo.getShuangLianPoleNum());
					         }
				         int panelNum = 0;
				         if (!CurtainChecker.isEmpty(m_OrderInfo.GetPanelNum()))
					         {
					           panelNum = Integer.parseInt(m_OrderInfo.GetPanelNum());
					         }
				         float gap = 0.0F;
				         if (!CurtainChecker.isEmpty(m_OrderInfo.GetGap()))
					         {
					           gap = Float.parseFloat(m_OrderInfo.GetGap());
					         }

				         float beamLength = (frameWidth - gap - tPoleNum * 25.4F - poleNum * 50.799999F - (duiKouPoleNum + shuangLianPoelNum) * 48.02F) / panelNum;

				         if (beamLength <= 0.0F)
					         {
					           JOptionPane.showMessageDialog(null, "横梁的长度小于等于零，窗户的宽度不合理！", "错误", 0);
					           return false;
					         }

				         float vaneLen = 0.0F;
				         int i = 0; for (int j = this.topDistsInfo.length; i < j; i++)
					         {
					           this.topDistsInfo[i].setUpBeamLength(beamLength);//上梁长度
					           this.topDistsInfo[i].setDownBeamLength(beamLength);//下梁长度

					           vaneLen = beamLength - 1.59F;
					           this.topDistsInfo[i].setVaneLength(vaneLen);//叶片长度

					           this.topDistsInfo[i].setDividerLength(beamLength);//分配器;分割者;间隔物;圆规？？
					           //磁盘窗格
					           this.topDistsInfo[i].setDistPaneNum(CalculateUtils.getSimpleRectDistPaneInfo(this.topDistsInfo[i].getHingeInstallType()).getPaneNum());
					         }

				       }
			       else
				       {
				         String[] tPolePosArray = tPolesPos.split(",");//T形立杆位置
				         float tPolePos = 0.0F;//TODO
				         float beamLength = 0.0F;
				         float distWidth = 0.0F;
				         float preTPolePos = 0.0F;
				         int frameType = m_OrderInfo.GetFrameType();
				         int frameNumPos = m_OrderInfo.GetFrameNumPos();
				         float vaneLen = 0.0F;
				         int i = 0; for (int j = this.topDistsInfo.length; i < j; i++)
					         {
					           if (i < this.topDistsInfo.length - 1)
						           {
						             tPolePos = Float.parseFloat(tPolePosArray[i].trim());
						           }

					           if (i == 0)
						           {
						             if (frameNumPos == 0)
							             {
							               distWidth = tPolePos - Float.parseFloat(Constants.FRAME_FOUR_INSIDE[frameType][0]) / 2.0F - 12.7F;
							             }
						             else if (frameNumPos == 1)
							             {
							               distWidth = tPolePos - Float.parseFloat(Constants.FRAME_FOUR_INSIDE_QIEDI[frameType][0]) / 2.0F - 12.7F;
							             }
						             else if (frameNumPos == 2)
							             {
							               distWidth = tPolePos - 12.7F;
							             }
						             else if ((frameNumPos == 3) || (frameNumPos == 4))
							             {
							               distWidth = tPolePos - Float.parseFloat(Constants.FRAME_THREE_INSIDE[frameType][0]) / 2.0F - 12.7F;
							             }
						             else if (frameNumPos == 5)
							             {
							               distWidth = tPolePos - Float.parseFloat(Constants.FRAME_ONE_INSIDE[frameType][0]) - 12.7F;
							             }
						             else if (frameNumPos == 6)
							             {
							               distWidth = tPolePos - 12.7F;
							             }
						             else if (frameNumPos == 7)
							             {
							               distWidth = tPolePos - Float.parseFloat(Constants.FRAME_TWO_INSIDE[frameType][0]) / 2.0F - 12.7F;
							             }

						           }
					           else if (i == j - 1)
						           {
						             if (frameNumPos == 0)
							             {
							               distWidth = Float.parseFloat(oriWidth) - tPolePos - Float.parseFloat(Constants.FRAME_FOUR_INSIDE[frameType][0]) / 2.0F - 12.7F;
							             }
						             else if (frameNumPos == 1)
							             {
							               distWidth = Float.parseFloat(oriWidth) - tPolePos - Float.parseFloat(Constants.FRAME_FOUR_INSIDE_QIEDI[frameType][0]) / 2.0F - 12.7F;
							             }
						             else if (frameNumPos == 2)
							             {
							               distWidth = Float.parseFloat(oriWidth) - tPolePos - 12.7F;
							             }
						             else if ((frameNumPos == 3) || (frameNumPos == 4))
							             {
							               distWidth = Float.parseFloat(oriWidth) - tPolePos - Float.parseFloat(Constants.FRAME_THREE_INSIDE[frameType][0]) / 2.0F - 12.7F;
							             }
						             else if (frameNumPos == 5)
							             {
							               distWidth = Float.parseFloat(oriWidth) - tPolePos - 12.7F;
							             }
						             else if (frameNumPos == 6)
							             {
							               distWidth = Float.parseFloat(oriWidth) - tPolePos - Float.parseFloat(Constants.FRAME_ONE_INSIDE[frameType][0]) - 12.7F;
							             }
						             else if (frameNumPos == 7)
							             {
							               distWidth = Float.parseFloat(oriWidth) - tPolePos - Float.parseFloat(Constants.FRAME_TWO_INSIDE[frameType][0]) / 2.0F - 12.7F;
							             }

						           }
					           else
						           {
						             distWidth = Float.parseFloat(tPolePosArray[i]) - preTPolePos - 25.4F;
						           }
					           hingeInfo = CalculateUtils.getSimpleRectDistPaneInfo(this.topDistsInfo[i].getHingeInstallType());
					           int poleNum = hingeInfo.getPoleNum();
					           int paneNum = hingeInfo.getPaneNum();
					           int duiKouPoleNum = hingeInfo.getDuikouPoleNum();
					           int shuangLianPoleNum = hingeInfo.getShuanglianPoleNum();
					           float gap = hingeInfo.getGap();

					           beamLength = (distWidth - gap - poleNum * 50.799999F - (duiKouPoleNum + shuangLianPoleNum) * 48.02F) / paneNum;

					           if (beamLength <= 0.0F)
						           {
						             JOptionPane.showMessageDialog(null, "横梁的长度小于等于零，窗户的宽度不合理！", "错误", 0);
						             return false;
						           }
					           preTPolePos = tPolePos;

					           this.topDistsInfo[i].setUpBeamLength(beamLength);
					           this.topDistsInfo[i].setDownBeamLength(beamLength);

					           this.topDistsInfo[i].setDividerLength(beamLength);

					           vaneLen = beamLength - 1.59F;
					           this.topDistsInfo[i].setVaneLength(vaneLen);

					           this.topDistsInfo[i].setDistPaneNum(CalculateUtils.getSimpleRectDistPaneInfo(this.topDistsInfo[i].getHingeInstallType()).getPaneNum());
					         }
				       }
			       if (level == 2)
				       {
				         boolean bottomSameWidth = m_OrderInfo.getBottomSameWidth();
				         tPolesPos = m_OrderInfo.getBottomTPolePos();
				         String bTPoleNum = m_OrderInfo.GetTPoleNum();

				         if ((m_OrderInfo.getSamePanelWidth()) && (!m_OrderInfo.getHTPoleExist()) && (!CurtainChecker.isEmpty(bTPoleNum)) && (Integer.parseInt(bTPoleNum) > 0))
					         {
					           String distHingeInstall = "";
					           HingeRelatedInfo distInfo = null;
					           HingeRelatedInfo bottomDistInfo = null;
					           String bottomHingeInstall = m_OrderInfo.getBottomHingeInstallType();
					           String[] bottomDistsHingeInstall = bottomHingeInstall.trim().toUpperCase().split("T");
					           float distWidth = 0.0F;
					           float beamLen = 0.0F;
					           int i = 0; for (int j = this.topDistsInfo.length; i < j; i++)
						           {
						             distHingeInstall = this.topDistsInfo[i].getHingeInstallType();
						             distInfo = CalculateUtils.getSimpleRectDistPaneInfo(distHingeInstall);

						             distWidth = this.topDistsInfo[i].getUpBeamLength() * distInfo.getPaneNum() + distInfo.getPoleNum() * 50.799999F + (distInfo.getDuikouPoleNum() + distInfo.getShuanglianPoleNum()) * 48.02F + distInfo.getGap();

						             System.out.println("topDistsInfo[i].getUpBeamLength()" + this.topDistsInfo[i].getUpBeamLength());
						             bottomDistInfo = CalculateUtils.getSimpleRectDistPaneInfo(bottomDistsHingeInstall[i]);
						             beamLen = (distWidth - bottomDistInfo.getGap() - bottomDistInfo.getPoleNum() * 50.799999F - (bottomDistInfo.getDuikouPoleNum() + bottomDistInfo.getShuanglianPoleNum()) * 48.02F) / bottomDistInfo.getPaneNum();

						             this.bottomDistsInfo[i].setUpBeamLength(beamLen);
						             this.bottomDistsInfo[i].setDownBeamLength(beamLen);

						             this.bottomDistsInfo[i].setVaneLength(beamLen - 1.59F);

						             this.bottomDistsInfo[i].setDividerLength(beamLen);

						             this.bottomDistsInfo[i].setDistPaneNum(bottomDistInfo.getPaneNum());
						           }
					         }
				         else if ((bottomSameWidth) || (CurtainChecker.isEmpty(tPolesPos)))
					         {
					           int tPoleNum = 0;
					           if (!CurtainChecker.isEmpty(m_OrderInfo.getBottomTPoleNum()))
						           {
						             tPoleNum = Integer.parseInt(m_OrderInfo.getBottomTPoleNum());
						           }
					           int poleNum = 0;
					           if (!CurtainChecker.isEmpty(m_OrderInfo.getBottomPoleNum()))
						           {
						             poleNum = Integer.parseInt(m_OrderInfo.getBottomPoleNum());
						           }
					           int duiKouPoleNum = 0;
					           if (!CurtainChecker.isEmpty(m_OrderInfo.getBottomDuiKouPoleNum()))
						           {
						             duiKouPoleNum = Integer.parseInt(m_OrderInfo.getBottomDuiKouPoleNum());
						           }
					           int shuangLianPoelNum = 0;
					           if (!CurtainChecker.isEmpty(m_OrderInfo.getBottomShuangLianPoleNum()))
						           {
						             shuangLianPoelNum = Integer.parseInt(m_OrderInfo.getBottomShuangLianPoleNum());
						           }
					           int panelNum = 0;
					           if (!CurtainChecker.isEmpty(m_OrderInfo.getBottomPanelNum()))
						           {
						             panelNum = Integer.parseInt(m_OrderInfo.getBottomPanelNum());
						           }
					           float gap = 0.0F;
					           if (!CurtainChecker.isEmpty(m_OrderInfo.getBottomGap()))
						           {
						             gap = Float.parseFloat(m_OrderInfo.getBottomGap());
						           }
					           float bottombeamLength = (frameWidth - gap - tPoleNum * 25.4F - poleNum * 50.799999F - (duiKouPoleNum + shuangLianPoelNum) * 48.02F) / panelNum;

					           float vaneLen = 0.0F;
					           int i = 0; for (int j = this.bottomDistsInfo.length; i < j; i++)
						           {
						             this.bottomDistsInfo[i].setUpBeamLength(bottombeamLength);
						             this.bottomDistsInfo[i].setDownBeamLength(bottombeamLength);

						             vaneLen = bottombeamLength - 1.59F;
						             this.bottomDistsInfo[i].setVaneLength(vaneLen);

						             this.bottomDistsInfo[i].setDividerLength(bottombeamLength);

						             this.bottomDistsInfo[i].setDistPaneNum(CalculateUtils.getSimpleRectDistPaneInfo(this.bottomDistsInfo[i].getHingeInstallType()).getPaneNum());
						           }
					         }
				         else
					         {
					           tPolesPos = m_OrderInfo.getBottomTPolePos();
					           String[] tPolePosArray = tPolesPos.split(",");
					           float tPolePos = 0.0F;
					           float beamLength = 0.0F;
					           float distWidth = 0.0F;
					           float preTPolePos = 0.0F;
					           int frameType = m_OrderInfo.GetFrameType();
					           int frameNumPos = m_OrderInfo.GetFrameNumPos();
					           float vaneLen = 0.0F;
					           int i = 0; for (int j = this.bottomLevelInfo.getDistInfo().length; i < j; i++)
						           {
						             if (i < j - 1)
							             {
							               tPolePos = Float.parseFloat(tPolePosArray[i].trim());
							             }
						             if (i == 0)
							             {
							               if (frameNumPos == 0)
								               {
								                 distWidth = tPolePos - Float.parseFloat(Constants.FRAME_FOUR_INSIDE[frameType][0]) / 2.0F - 12.7F;
								               }
							               else if (frameNumPos == 1)
								               {
								                 distWidth = tPolePos - Float.parseFloat(Constants.FRAME_FOUR_INSIDE_QIEDI[frameType][0]) / 2.0F - 12.7F;
								               }
							               else if (frameNumPos == 2)
								               {
								                 distWidth = tPolePos - 12.7F;
								               }
							               else if ((frameNumPos == 3) || (frameNumPos == 4))
								               {
								                 distWidth = tPolePos - Float.parseFloat(Constants.FRAME_THREE_INSIDE[frameType][0]) / 2.0F - 12.7F;
								               }
							               else if (frameNumPos == 5)
								               {
								                 distWidth = tPolePos - Float.parseFloat(Constants.FRAME_ONE_INSIDE[frameType][0]) - 12.7F;
								               }
							               else if (frameNumPos == 6)
								               {
								                 distWidth = tPolePos - 12.7F;
								               }
							               else if (frameNumPos == 7)
								               {
								                 distWidth = tPolePos - Float.parseFloat(Constants.FRAME_TWO_INSIDE[frameType][0]) / 2.0F - 12.7F;
								               }

							             }
						             else if (i == j - 1)
							             {
							               if (frameNumPos == 0)
								               {
								                 distWidth = Float.parseFloat(oriWidth) - tPolePos - Float.parseFloat(Constants.FRAME_FOUR_INSIDE[frameType][0]) / 2.0F - 12.7F;
								               }
							               else if (frameNumPos == 1)
								               {
								                 distWidth = Float.parseFloat(oriWidth) - tPolePos - Float.parseFloat(Constants.FRAME_FOUR_INSIDE_QIEDI[frameType][0]) / 2.0F - 12.7F;
								               }
							               else if (frameNumPos == 2)
								               {
								                 distWidth = Float.parseFloat(oriWidth) - tPolePos - 12.7F;
								               }
							               else if ((frameNumPos == 3) || (frameNumPos == 4))
								               {
								                 distWidth = Float.parseFloat(oriWidth) - tPolePos - Float.parseFloat(Constants.FRAME_THREE_INSIDE[frameType][0]) / 2.0F - 12.7F;
								               }
							               else if (frameNumPos == 5)
								               {
								                 distWidth = Float.parseFloat(oriWidth) - tPolePos - 12.7F;
								               }
							               else if (frameNumPos == 6)
								               {
								                 distWidth = Float.parseFloat(oriWidth) - tPolePos - Float.parseFloat(Constants.FRAME_ONE_INSIDE[frameType][0]) - 12.7F;
								               }
							               else if (frameNumPos == 7)
								               {
								                 distWidth = Float.parseFloat(oriWidth) - tPolePos - Float.parseFloat(Constants.FRAME_TWO_INSIDE[frameType][0]) / 2.0F - 12.7F;
								               }

							             }
						             else
							             {
							               distWidth = Float.parseFloat(tPolePosArray[i]) - preTPolePos - 25.4F;
							             }
						             hingeInfo = CalculateUtils.getSimpleRectDistPaneInfo(this.bottomDistsInfo[i].getHingeInstallType());
						             int poleNum = hingeInfo.getPoleNum();
						             int paneNum = hingeInfo.getPaneNum();
						             int duiKouPoleNum = hingeInfo.getDuikouPoleNum();
						             int shuangLianPoleNum = hingeInfo.getShuanglianPoleNum();
						             float gap = hingeInfo.getGap();
						             preTPolePos = tPolePos;

						             beamLength = (distWidth - gap - poleNum * 50.799999F - (duiKouPoleNum + shuangLianPoleNum) * 48.02F) / paneNum;

						             this.bottomDistsInfo[i].setUpBeamLength(beamLength);
						             this.bottomDistsInfo[i].setDownBeamLength(beamLength);

						             vaneLen = beamLength - 1.59F;
						             this.bottomDistsInfo[i].setVaneLength(beamLength - 1.59F);

						             this.bottomDistsInfo[i].setDividerLength(beamLength);

						             this.bottomDistsInfo[i].setDistPaneNum(CalculateUtils.getSimpleRectDistPaneInfo(this.bottomDistsInfo[i].getHingeInstallType()).getPaneNum());
						           }

					         }

				       }

			       return true;
			     }

		     private void calVaneNumAndBeamWidth()
		     {
			       if (m_OrderInfo.getIsBoard())//实木
				       {
				         this.topLevelInfo.setUpBeamWidth(100.0F);
				         this.topLevelInfo.setDownBeanWidth(100.0F);
				       }
			       else // 非实木
				       {
				         float poleLength = this.topLevelInfo.getPoleLength(); // 立杆高度

				         int dividerNum = 0;
				         if (!CurtainChecker.isEmpty(m_OrderInfo.GetDividerNum()))
					         {
					           dividerNum = Integer.parseInt(m_OrderInfo.GetDividerNum());
					         }
				         if (dividerNum == -1)
					         {
					           dividerNum = 0;
					         }
				         float dividerWidth = 0.0F;
				         if (dividerNum > 0)
					         {
					           dividerWidth = Float.parseFloat(Constants.DIVIDERTYPE[m_OrderInfo.GetDividerType()]);
					         }

				         float minBeamWidth = 0.0F;
				         float tmpVaneNum = 0.0F;
				         int vaneNum = 0; // 叶片数量！
				         float upBeamWidth = 0.0F;
				         float downBeamWidth = 0.0F;

				          // VANETYPE = { "63.50", "88.90", "114.30", "48.00", "31.00" };
				         int vaneType = m_OrderInfo.GetVaneType(); // 叶片类型

				         float vaneWidth = Float.parseFloat(Constants.VANETYPE[vaneType]); // 叶片宽度

				         if (vaneType == 0)
					         {
					           minBeamWidth = 105.4F;

					           tmpVaneNum = (poleLength - dividerWidth * dividerNum - minBeamWidth * 2.0F) / (vaneWidth - 12.7F);

					           vaneNum = StrictMath.round(tmpVaneNum);// 四舍五入
							  // 最小横梁宽度
					           minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
					         }
				         else if (vaneType == 1)
					         {
					           minBeamWidth = 114.3F;
					           tmpVaneNum = (poleLength - dividerWidth * dividerNum - minBeamWidth * 2.0F) / (vaneWidth - 12.7F);

					           vaneNum = StrictMath.round(tmpVaneNum);

					           minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
					         }
				         else if (vaneType == 2)
					         {
					           minBeamWidth = 133.35001F;
					           tmpVaneNum = (poleLength - dividerWidth * dividerNum - minBeamWidth * 2.0F) / (vaneWidth - 12.7F);

					           vaneNum = StrictMath.round(tmpVaneNum);

					           minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
					         }
				         else if (vaneType == 3)
					         {
					           minBeamWidth = 100.0F;
					           tmpVaneNum = (poleLength - dividerWidth * dividerNum - minBeamWidth * 2.0F) / (vaneWidth - 8.0F);

					           vaneNum = StrictMath.round(tmpVaneNum);

					           minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 8.0F)) / 2.0F;
					         }
				         else if (vaneType == 4)
					         {
					           minBeamWidth = 87.5F;
					           tmpVaneNum = (poleLength - dividerWidth * dividerNum - minBeamWidth * 2.0F) / (vaneWidth - 6.0F);

					           vaneNum = StrictMath.round(tmpVaneNum);

					           minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 6.0F)) / 2.0F;
					         }

					         // 根据合页类型计算 上横梁 下横梁宽度
				         if (vaneType == 0)
					         {
					           while (true)
						           {
						             if (minBeamWidth < 80.0F)
							             {
							               vaneNum--;
							               minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
							               continue;
							             }if (minBeamWidth <= 130.8F)
							               break;
						             vaneNum++;
						             minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
						           }

					           float halfVaneWidth = (vaneWidth - 12.7F) / 2.0F;

					           if (minBeamWidth - halfVaneWidth >= 80.0F)
						           {
						             while (true)
							             {
							               minBeamWidth -= halfVaneWidth;
							               vaneNum++;
							               if (minBeamWidth - halfVaneWidth < 80.0F)
								               {
								                 break;
								               }

							             }

						           }

					           upBeamWidth = minBeamWidth;
					           downBeamWidth = minBeamWidth;
					         }
				         if (vaneType == 1)
					         {
					           while (true)
						           {
						             if (minBeamWidth < 76.199997F)
							             {
							               vaneNum--;
							               minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
							               continue;
							             }if (minBeamWidth <= 152.39999F)
							               break;
						             vaneNum++;
						             minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
						           }

					           float halfVaneWidth = (vaneWidth - 12.7F) / 2.0F;

					           if (minBeamWidth - halfVaneWidth >= 76.199997F)
						           {
						             while (true)
							             {
							               minBeamWidth -= halfVaneWidth;
							               vaneNum++;
							               if (minBeamWidth - halfVaneWidth < 76.199997F)
								               {
								                 break;
								               }

							             }

						           }

					           upBeamWidth = minBeamWidth;
					           downBeamWidth = minBeamWidth;
					         }
				         if (vaneType == 2)
					         {
					           if ((minBeamWidth >= 114.3F) && (minBeamWidth <= 152.40000000000001D))
						           {
						             upBeamWidth = minBeamWidth;
						             downBeamWidth = minBeamWidth;

						             float halfVaneWidth = (vaneWidth - 12.7F) / 2.0F;

						             if (minBeamWidth - halfVaneWidth >= 114.3F)
							             {
							               while (true)
								               {
								                 minBeamWidth -= halfVaneWidth;
								                 vaneNum++;
								                 if (minBeamWidth - halfVaneWidth < 114.3F)
									                 {
									                   break;
									                 }
								               }
							             }
						           }
					           else if (minBeamWidth < 114.3F)
						           {
						             if (minBeamWidth * 2.0F > 114.3F)
							             {
							               downBeamWidth = 114.3F;
							               upBeamWidth = minBeamWidth * 2.0F - 114.3F;
							             }
						             else
							             {
							               do
								               {
								                 vaneNum--;
								                 minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
								                 if ((minBeamWidth < 114.3F) || (minBeamWidth > 152.39999F))
									                   continue;
								                 upBeamWidth = minBeamWidth;
								                 downBeamWidth = minBeamWidth;
								                 break;
								               }
							               while ((minBeamWidth >= 114.3F) ||
											                 (minBeamWidth * 2.0F <= 114.3F));

							               downBeamWidth = 114.3F;
							               upBeamWidth = minBeamWidth * 2.0F - 114.3F;
							             }

						           }
					           else
						           {
						             while (true)
							             {
							               vaneNum++;
							               minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
							               if ((minBeamWidth >= 114.3F) && (minBeamWidth <= 152.39999F))
								               {
								                 upBeamWidth = minBeamWidth;
								                 downBeamWidth = minBeamWidth;
								               }
							               else {
								                 if (minBeamWidth >= 114.3F)
									                   continue;
								                 if (minBeamWidth * 2.0F > 114.3F)
									                 {
									                   downBeamWidth = 114.3F;
									                   upBeamWidth = minBeamWidth * 2.0F - 114.3F;
									                 }
								                 else
									                 {
									                   downBeamWidth = 114.3F;
									                   upBeamWidth = minBeamWidth * 2.0F;
									                 }
								               }
							             }
						           }
					         }

				         if (vaneType == 3)
					         {
					           while (true)
						           {
						             if (minBeamWidth < 80.0F)
							             {
							               vaneNum--;
							               minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 8.0F)) / 2.0F;
							               continue;
							             }if (minBeamWidth <= 120.0F)
							               break;
						             vaneNum++;
						             minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 8.0F)) / 2.0F;
						           }

					           float halfVaneWidth = (vaneWidth - 8.0F) / 2.0F;

					           if (minBeamWidth - halfVaneWidth >= 80.0F)
						           {
						             while (true)
							             {
							               minBeamWidth -= halfVaneWidth;
							               vaneNum++;
							               if (minBeamWidth - halfVaneWidth < 80.0F)
								               {
								                 break;
								               }

							             }

						           }

					           upBeamWidth = minBeamWidth + 2.3F;
					           downBeamWidth = minBeamWidth + 2.3F;
					         }
				         if (vaneType == 4)
					         {
					           while (true)
						           {
						             if (minBeamWidth < 75.0F)
							             {
							               vaneNum--;
							               minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 6.0F)) / 2.0F;
							               continue;
							             }if (minBeamWidth <= 100.0F)
							               break;
						             vaneNum++;
						             minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 6.0F)) / 2.0F;
						           }

					           float halfVaneWidth = (vaneWidth - 6.0F) / 2.0F;

					           if (minBeamWidth - halfVaneWidth >= 75.0F)
						           {
						             while (true)
							             {
							               minBeamWidth -= halfVaneWidth;
							               vaneNum++;
							               if (minBeamWidth - halfVaneWidth < 75.0F)
								               {
								                 break;
								               }

							             }

						           }

					           upBeamWidth = minBeamWidth;
					           downBeamWidth = minBeamWidth;
					         }
				         this.topLevelInfo.vaneNumPerPane(vaneNum);

				         this.topLevelInfo.setUpBeamWidth(upBeamWidth);

				         this.topLevelInfo.setDownBeanWidth(downBeamWidth);
				       }
				    // 两层的情况
			       if (m_OrderInfo.GetLevel().trim().equals("2"))
				       {
				         if (m_OrderInfo.getBottomIsBoard())    // 下层为实木
					         {
					           this.bottomLevelInfo.setUpBeamWidth(100.0F);
					           this.bottomLevelInfo.setDownBeanWidth(100.0F);
					         }
				         else      // 下层非实木
					         {
					         	// 立杆长度
					           float poleLength = this.bottomLevelInfo.getPoleLength();

					           int dividerNum = 0;   // 分隔梁数量
					           if (!CurtainChecker.isEmpty(m_OrderInfo.getBottomDividerNum()))
						           {
						             dividerNum = Integer.parseInt(m_OrderInfo.getBottomDividerNum());
						           }
					           if (dividerNum == -1)
						           {
						             dividerNum = 0;
						           }
					           float dividerWidth = 0.0F;
					           if (dividerNum > 0)
						           {
						             String dividerType = m_OrderInfo.getBottomDividerType();
						             if (CurtainChecker.isEmpty(dividerType));
						             // 分隔梁宽度
						             dividerWidth = Float.parseFloat(m_OrderInfo.getBottomDividerType());
						           }

					           float minBeamWidth = 0.0F;
					           float tmpVaneNum = 0.0F;
					           int vaneNum = 0;
					           String vaneTypeStr = m_OrderInfo.getBottomVaneType();
					           float vaneWidth = Float.parseFloat(vaneTypeStr);
					           // VANETYPE = { "63.50", "88.90", "114.30", "48.00", "31.00" };
					           if (vaneTypeStr.trim().equals(Constants.VANETYPE[0]))
						           {
						             minBeamWidth = 105.4F;
						             tmpVaneNum = (poleLength - dividerWidth * dividerNum - minBeamWidth * 2.0F) / (vaneWidth - 12.7F);

						             vaneNum = StrictMath.round(tmpVaneNum);

						             minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
						           }
					           else if (vaneTypeStr.trim().equals(Constants.VANETYPE[1]))
						           {
						             minBeamWidth = 114.3F;
						             tmpVaneNum = (poleLength - dividerWidth * dividerNum - minBeamWidth * 2.0F) / (vaneWidth - 12.7F);

						             vaneNum = StrictMath.round(tmpVaneNum);

						             minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
						           }
					           else if (vaneTypeStr.trim().equals(Constants.VANETYPE[2]))
						           {
						             minBeamWidth = 133.35001F;
						             tmpVaneNum = (poleLength - dividerWidth * dividerNum - minBeamWidth * 2.0F) / (vaneWidth - 12.7F);

						             vaneNum = StrictMath.round(tmpVaneNum);

						             minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
						           }
					           else if (vaneTypeStr.trim().equals(Constants.VANETYPE[3]))
						           {
						             minBeamWidth = 100.0F;
						             tmpVaneNum = (poleLength - dividerWidth * dividerNum - minBeamWidth * 2.0F) / (vaneWidth - 8.0F);

						             vaneNum = StrictMath.round(tmpVaneNum);

						             minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 8.0F)) / 2.0F;
						           }
					           else if (vaneTypeStr.trim().equals(Constants.VANETYPE[4]))
						           {
						             minBeamWidth = 87.5F;
						             tmpVaneNum = (poleLength - dividerWidth * dividerNum - minBeamWidth * 2.0F) / (vaneWidth - 6.0F);

						             vaneNum = StrictMath.round(tmpVaneNum);

						             minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 6.0F)) / 2.0F;
						           }

					           float upBeamWidth = 0.0F;
					           float downBeamWidth = 0.0F;

					           if (vaneTypeStr.trim().equals(Constants.VANETYPE[0]))
						           {
						             while (true)
							             {
							               if (minBeamWidth < 80.0F)
								               {
								                 vaneNum--;
								                 minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
								                 continue;
								               }if (minBeamWidth <= 130.8F)
								                 break;
							               vaneNum++;
							               minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
							             }

						             float halfVaneWidth = (vaneWidth - 12.7F) / 2.0F;

						             if (minBeamWidth - halfVaneWidth >= 80.0F)
							             {
							               while (true)
								               {
								                 minBeamWidth -= halfVaneWidth;
								                 vaneNum++;
								                 if (minBeamWidth - halfVaneWidth < 80.0F)
									                 {
									                   break;
									                 }

								               }

							             }

						             upBeamWidth = minBeamWidth;
						             downBeamWidth = minBeamWidth;
						           }
					           if (vaneTypeStr.trim().equals(Constants.VANETYPE[1]))
						           {
						             while (true)
							             {
							               if (minBeamWidth < 76.199997F)
								               {
								                 vaneNum--;
								                 minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
								                 continue;
								               }if (minBeamWidth <= 152.39999F)
								                 break;
							               vaneNum++;
							               minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
							             }

						             float halfVaneWidth = (vaneWidth - 12.7F) / 2.0F;

						             if (minBeamWidth - halfVaneWidth >= 76.199997F)
							             {
							               while (true)
								               {
								                 minBeamWidth -= halfVaneWidth;
								                 vaneNum++;
								                 if (minBeamWidth - halfVaneWidth < 76.199997F)
									                 {
									                   break;
									                 }

								               }

							             }

						             upBeamWidth = minBeamWidth;
						             downBeamWidth = minBeamWidth;
						           }
					           if (vaneTypeStr.trim().equals(Constants.VANETYPE[2]))
						           {
						             if ((minBeamWidth >= 114.3F) && (minBeamWidth <= 152.40000000000001D))
							             {
							               upBeamWidth = minBeamWidth;
							               downBeamWidth = minBeamWidth;

							               float halfVaneWidth = (vaneWidth - 12.7F) / 2.0F;

							               if (minBeamWidth - halfVaneWidth >= 114.3F)
								               {
								                 while (true)
									                 {
									                   minBeamWidth -= halfVaneWidth;
									                   vaneNum++;
									                   if (minBeamWidth - halfVaneWidth < 114.3F)
										                   {
										                     break;
										                   }
									                 }
								               }
							             }
						             else if (minBeamWidth < 114.3F)
							             {
							               if (minBeamWidth * 2.0F > 114.3F)
								               {
								                 downBeamWidth = 114.3F;
								                 upBeamWidth = minBeamWidth * 2.0F - 114.3F;
								               }
							               else
								               {
								                 do
									                 {
									                   vaneNum--;
									                   minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
									                   if ((minBeamWidth < 114.3F) || (minBeamWidth > 152.40000000000001D))
										                     continue;
									                   upBeamWidth = minBeamWidth;
									                   downBeamWidth = minBeamWidth;
									                   break;
									                 }
								                 while ((minBeamWidth >= 114.3F) ||
												                   (minBeamWidth * 2.0F <= 114.3F));

								                 downBeamWidth = 114.3F;
								                 upBeamWidth = minBeamWidth * 2.0F - 114.3F;
								               }

							             }
						             else
							             {
							               while (true)
								               {
								                 vaneNum++;
								                 minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
								                 if ((minBeamWidth >= 114.3F) && (minBeamWidth <= 152.40000000000001D))
									                 {
									                   upBeamWidth = minBeamWidth;
									                   downBeamWidth = minBeamWidth;
									                 }
								                 else {
									                   if (minBeamWidth >= 114.3F)
										                     continue;
									                   if (minBeamWidth * 2.0F > 114.3F)
										                   {
										                     downBeamWidth = 114.3F;
										                     upBeamWidth = minBeamWidth * 2.0F - 114.3F;
										                   }
									                   else
										                   {
										                     downBeamWidth = 114.3F;
										                     upBeamWidth = minBeamWidth * 2.0F;
										                   }
									                 }
								               }
							             }
						           }

					           if (vaneTypeStr.trim().equals(Constants.VANETYPE[3]))
						           {
						             while (true)
							             {
							               if (minBeamWidth < 80.0F)
								               {
								                 vaneNum--;
								                 minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 8.0F)) / 2.0F;
								                 continue;
								               }if (minBeamWidth <= 120.0F)
								                 break;
							               vaneNum++;
							               minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 8.0F)) / 2.0F;
							             }

						             float halfVaneWidth = (vaneWidth - 8.0F) / 2.0F;

						             if (minBeamWidth - halfVaneWidth >= 80.0F)
							             {
							               while (true)
								               {
								                 minBeamWidth -= halfVaneWidth;
								                 vaneNum++;
								                 if (minBeamWidth - halfVaneWidth < 80.0F)
									                 {
									                   break;
									                 }

								               }

							             }

						             upBeamWidth = minBeamWidth + 2.3F;
						             downBeamWidth = minBeamWidth + 2.3F;
						           }
					           if (vaneTypeStr.trim().equals(Constants.VANETYPE[4]))
						           {
						             while (true)
							             {
							               if (minBeamWidth < 75.0F)
								               {
								                 vaneNum--;
								                 minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 6.0F)) / 2.0F;
								                 continue;
								               }if (minBeamWidth <= 100.0F)
								                 break;
							               vaneNum++;
							               minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 6.0F)) / 2.0F;
							             }

						             float halfVaneWidth = (vaneWidth - 6.0F) / 2.0F;

						             if (minBeamWidth - halfVaneWidth >= 75.0F)
							             {
							               while (true)
								               {
								                 minBeamWidth -= halfVaneWidth;
								                 vaneNum++;
								                 if (minBeamWidth - halfVaneWidth < 75.0F)
									                 {
									                   break;
									                 }

								               }

							             }

						             upBeamWidth = minBeamWidth;
						             downBeamWidth = minBeamWidth;
						           }
					           this.bottomLevelInfo.vaneNumPerPane(vaneNum);

					           this.bottomLevelInfo.setUpBeamWidth(upBeamWidth);

					           this.bottomLevelInfo.setDownBeanWidth(downBeamWidth);
					         }
				       }
			     }

		     private void autoAddDivider()
		     {
			       if (m_OrderInfo.getAutoAddDivider())
				       {
				         float poleLen = winCalResult.getLeveInfo()[0].getPoleLength();//立杆长度
				         int vaneType = m_OrderInfo.GetVaneType();// 叶片规格
				// 分隔梁数量等于空  or    分隔梁数量等于空 &&  分隔梁数量 = 0
				         if ((CurtainChecker.isEmpty(m_OrderInfo.GetDividerNum())) || ((!CurtainChecker.isEmpty(m_OrderInfo.GetDividerNum())) && (Integer.parseInt(m_OrderInfo.GetDividerNum()) == 0)))
					         {
					         	// 叶片规格决定分隔梁类型
					           if ((vaneType == 0) || (vaneType == 2)) {
						             m_OrderInfo.SaveDividerType(2);
						           }
					           else if (vaneType == 1) {
						             m_OrderInfo.SaveDividerType(0);
						           }
					           else if (vaneType == 3)
						           {
						             m_OrderInfo.SaveDividerType(1);
						           }
					           else
						           {
						             m_OrderInfo.SaveDividerType(3);
						           }

					           if ((vaneType == 4) && (poleLen >= 1100.0F))
						           {
						             m_OrderInfo.SaveDividerPos(new Float(poleLen / 2.0F).toString());
						             m_OrderInfo.SaveDividerNum("1");
						           }

					           if (((vaneType == 0) || (vaneType == 1) || (vaneType == 2) || (vaneType == 3)) && (poleLen >= 1600.0F))
						           {
						             m_OrderInfo.SaveDividerPos(new Float(poleLen / 2.0F).toString());
						             m_OrderInfo.SaveDividerNum("1");
						           }

					         }
				         //层数 =2 && (下方分隔梁数量等于空 || (下方分隔梁数!=空 && 下方分隔梁数 == 0))
				         if ((m_OrderInfo.GetLevel().trim().equals("2")) && ((CurtainChecker.isEmpty(m_OrderInfo.getBottomDividerNum())) || ((!CurtainChecker.isEmpty(m_OrderInfo.getBottomDividerNum())) && (Integer.parseInt(m_OrderInfo.getBottomDividerNum()) == 0))))
					         {
					           String bottomVaneType = m_OrderInfo.getBottomVaneType();
					           if ((bottomVaneType.trim().equals(Constants.VANETYPE[0])) || (bottomVaneType.trim().equals(Constants.VANETYPE[2])))
						           {
						             m_OrderInfo.saveBottomDividerType(Constants.DIVIDERTYPE[2]);
						           }
					           else if (bottomVaneType.trim().equals(Constants.VANETYPE[1]))
						           {
						             m_OrderInfo.saveBottomDividerType(Constants.DIVIDERTYPE[0]);
						           }
					           else if ((bottomVaneType.trim().equals(Constants.VANETYPE[3])) || (bottomVaneType.trim().equals(Constants.VANETYPE[4])))
						           {
						             m_OrderInfo.saveBottomDividerType(Constants.DIVIDERTYPE[1]);
						           }
					           else
						           {
						             m_OrderInfo.saveBottomDividerType(Constants.DIVIDERTYPE[3]);
						           }
					           poleLen = winCalResult.getLeveInfo()[1].getPoleLength();
					           if ((bottomVaneType.trim().equals(Constants.VANETYPE[4])) && (poleLen >= 1100.0F))
						           {
						             m_OrderInfo.saveBottomDividerPos(new Float(poleLen / 2.0F).toString());
						             m_OrderInfo.saveBottomDividerNum("1");
						           }

					           if (((bottomVaneType.trim().equals(Constants.VANETYPE[0])) || (bottomVaneType.trim().equals(Constants.VANETYPE[1])) || (bottomVaneType.trim().equals(Constants.VANETYPE[2])) || (bottomVaneType.trim().equals(Constants.VANETYPE[3]))) && (poleLen >= 1600.0F))
						           {
						             m_OrderInfo.saveBottomDividerPos(new Float(poleLen / 2.0F).toString());
						             m_OrderInfo.saveBottomDividerNum("1");
						           }
					         }
				       }
			     }

		     private boolean calDividerPos()
		     {
			       int dividerNum = 0;

			       int frameNumPos = m_OrderInfo.GetFrameNumPos();//外框数量和位置

			       int frameType = m_OrderInfo.GetFrameType();// 外框类型

			       if (!CurtainChecker.isEmpty(m_OrderInfo.GetDividerNum()))// 分隔梁数量
				       {
				         dividerNum = Integer.parseInt(m_OrderInfo.GetDividerNum());
				       }
			       float outFrameWidth = 0.0F;
			       if (frameNumPos == 0)
				       {
				         outFrameWidth = Float.parseFloat(Constants.FRAME_FOUR_INSIDE[frameType][0]) / 2.0F;
				       }
			       else if (frameNumPos == 1)
				       {
				         outFrameWidth = Float.parseFloat(Constants.FRAME_FOUR_INSIDE_QIEDI[frameType][0]) / 2.0F;
				       }
			       else if (frameNumPos == 2)
				       {
				         outFrameWidth = 0.0F;
				       }
			       else if (frameNumPos == 3)
				       {
				         outFrameWidth = 0.0F;
				       }
			       else if (frameNumPos == 4)
				       {
				         outFrameWidth = Float.parseFloat(Constants.FRAME_THREE_INSIDE[frameType][0]);
				       }
			       else if ((frameNumPos == 5) || (frameNumPos == 6))
				       {
				         outFrameWidth = 0.0F;
				       }
			       else if (frameNumPos == 7)
				       {
				         outFrameWidth = 0.0F;
				       }

			       if ((!m_OrderInfo.getIsBoard()) && (dividerNum > 0))
				       {
				         int[] result = new int[3];
				         float downBeamWidth = this.topLevelInfo.getDownBeamWidth();
				         float dividerWidth = Float.parseFloat(Constants.DIVIDERTYPE[m_OrderInfo.GetDividerType()]);
				         int vaneNum = this.topLevelInfo.getVaneNumPerPane();
				         int vaneType = m_OrderInfo.GetVaneType();
				         float vaneWidth = Float.parseFloat(Constants.VANETYPE[vaneType]);
				         String strPos = m_OrderInfo.GetDivederPos();
				         String[] strPosTmp = strPos.split(",");

				         float overlapSize = 0.0F;
				         switch (vaneType) {
					         case 0:
						           overlapSize = 12.7F;
						           break;
					         case 1:
						           overlapSize = 12.7F;
						           break;
					         case 2:
						           overlapSize = 12.7F;
						           break;
					         case 3:
						           overlapSize = 8.0F;
						           break;
					         case 4:
						           overlapSize = 6.0F;
						         }

				         int downVaneNum = 0;
				         float fDownVaneNum = 0.0F;
				         for (int i = 0; i < dividerNum; i++) {
					           if (i == 0)
						           {
						             if (m_OrderInfo.GetLevel().trim().equals("1"))
							             {
											 fDownVaneNum = (Float.parseFloat(strPosTmp[i]) - downBeamWidth - dividerWidth / 2.0F - outFrameWidth - 1.59F) / (vaneWidth - overlapSize);
							             }
						             else
							             {
							               float tPoleHeight = 25.4F;
							               float hTPolePos = Float.parseFloat(m_OrderInfo.getHtPolePos());
							               if (m_OrderInfo.getHTPoleExist())
								               {
												   fDownVaneNum = (Float.parseFloat(strPosTmp[i]) - hTPolePos - tPoleHeight / 2.0F - 1.585F - downBeamWidth - dividerWidth / 2.0F) / (vaneWidth - overlapSize);
								               }
							               else
								               {
												   fDownVaneNum = (Float.parseFloat(strPosTmp[i]) - hTPolePos - 3.17F - downBeamWidth - dividerWidth / 2.0F) / (vaneWidth - overlapSize);
								               }
							             }

						           }
					           else
						           {
						             fDownVaneNum = (Float.parseFloat(strPosTmp[i]) - Float.parseFloat(strPosTmp[(i - 1)]) - dividerWidth) / (vaneWidth - overlapSize);
						           }

					           if (fDownVaneNum < 1.0F)
						           {
						             JOptionPane.showMessageDialog(null, "(上层窗户)分隔梁位置太低，不合理，请检查", "错误", 0);
						             return false;
						           }

					           if (fDownVaneNum > vaneNum - 1)
						           {
						             JOptionPane.showMessageDialog(null, "(上层窗户)分隔梁位置太高，不合理，请检查", "错误", 0);

						             return false;
						           }
					           downVaneNum = StrictMath.round(fDownVaneNum);

					           result[i] = downVaneNum;
					         }

				         int[] bestResult = new int[3];
				         int aboveDivider = 0;
				         int aboveVaneNum = 0;
				         float height = 0.0F;
				         float distance = 0.0F;
				         for (int i = 0; i < dividerNum; i++) {
					           aboveDivider = i;
					           aboveVaneNum += result[i];

					           height = outFrameWidth + 1.59F + aboveDivider * dividerWidth + dividerWidth / 2.0F + downBeamWidth + aboveVaneNum * (vaneWidth - overlapSize);

					           distance = height - Float.parseFloat(strPosTmp[i]);
					           if (Math.abs(distance) <= dividerWidth / 2.0F)
						           {
						             bestResult[i] = result[i];
						           }
					           else if (distance > 0.0F) {
						             aboveVaneNum--;
						             result[i] -= 1;
						             if (i != dividerNum - 1)
							               result[(i + 1)] += 1;
						           }
					           else
						           {
						             aboveVaneNum++;
						             result[i] += 1;
						             if (i != dividerNum - 1) {
							               result[(i + 1)] -= 1;
							             }
						           }

					         }

				         this.topLevelInfo.setDividerPos(bestResult);
				       }

			       int bottomDividerNum = 0;
			       if (!CurtainChecker.isEmpty(m_OrderInfo.getBottomDividerNum()))
				       {
				         bottomDividerNum = Integer.parseInt(m_OrderInfo.getBottomDividerNum());
				       }
			       if ((m_OrderInfo.GetLevel().trim().equals("2")) && (!m_OrderInfo.getBottomIsBoard()) && (bottomDividerNum > 0))
				       {
				         int[] bottomResult = new int[3];

				         float bottomDownBeamWidth = this.bottomLevelInfo.getDownBeamWidth();
				         float bottomDividerWidth = Float.parseFloat(m_OrderInfo.getBottomDividerType());
				         int bottomVaneNum = this.bottomLevelInfo.getVaneNumPerPane();
				         String bottomVaneTypeStr = m_OrderInfo.getBottomVaneType();
				         float bottomVaneWidth = 0.0F;
				         if (!CurtainChecker.isEmpty(bottomVaneTypeStr))
					         {
					           bottomVaneWidth = Float.parseFloat(bottomVaneTypeStr);
					         }
				         String bottomDividerPos = m_OrderInfo.getBottomDividerPos();
				         String[] bottomStrPosTmp = bottomDividerPos.split(",");

				         float overlapSize = 0.0F;
				         if ((bottomVaneTypeStr.trim().equals(Constants.VANETYPE[0])) || (bottomVaneTypeStr.trim().equals(Constants.VANETYPE[1])) || (bottomVaneTypeStr.trim().equals(Constants.VANETYPE[2])))
					         {
					           overlapSize = 12.7F;
					         }
				         else if (bottomVaneTypeStr.trim().equals(Constants.VANETYPE[3]))
					         {
					           overlapSize = 8.0F;
					         }
				         else if (bottomVaneTypeStr.trim().equals(Constants.VANETYPE[4]))
					         {
					           overlapSize = 6.0F;
					         }
				         int bttomDownVaneNum = 0;
				         float bttomFDownVaneNum = 0.0F;
				         for (int i = 0; i < bottomDividerNum; i++)
					         {
					           if (i == 0)
						           {
						             // bttomFDownVaneNum = (Float.parseFloat(bottomStrPosTmp[i]) - outFrameWidth - 1.59F - bottomDownBeamWidth - bottomDividerWidth  (bottomVaneWidth - overlapSize);
						             bttomFDownVaneNum = 0;
						           }
					           else
						           {
						             bttomFDownVaneNum = (Float.parseFloat(bottomStrPosTmp[i]) - Float.parseFloat(bottomStrPosTmp[(i - 1)]) - bottomDividerWidth) / (bottomVaneWidth - overlapSize);
						           }

					           if (bttomFDownVaneNum < 1.0F)
						           {
						             JOptionPane.showMessageDialog(null, "底层分隔梁位置太低，不合理，请检查", "错误", 0);

						             return false;
						           }

					           if (bttomFDownVaneNum > bottomVaneNum - 1)
						           {
						             JOptionPane.showMessageDialog(null, "底层分隔梁位置太高，不合理，请检查", "错误", 0);

						             return false;
						           }
					           bttomDownVaneNum = StrictMath.round(bttomFDownVaneNum);

					           bottomResult[i] = bttomDownVaneNum;
					         }

				         int[] bestResult = new int[3];
				         int aboveDivider = 0;
				         int aboveVaneNum = 0;
				         float height = 0.0F;
				         float distance = 0.0F;
				         for (int i = 0; i < bottomDividerNum; i++) {
					           aboveDivider = i;
					           aboveVaneNum += bottomResult[i];

					           height = aboveDivider * bottomDividerWidth + bottomDividerWidth / 2.0F + bottomDownBeamWidth + aboveVaneNum * (bottomVaneWidth - overlapSize);

					           distance = height - Float.parseFloat(bottomStrPosTmp[i]);
					           if (Math.abs(distance) <= bottomDividerWidth / 2.0F)
						           {
						             bestResult[i] = bottomResult[i];
						           }
					           else if (distance > 0.0F) {
						             aboveVaneNum--;
						             bottomResult[i] -= 1;
						             if (i != dividerNum - 1)
							               bottomResult[(i + 1)] += 1;
						           }
					           else
						           {
						             aboveVaneNum++;
						             bottomResult[i] += 1;
						             if (i != dividerNum - 1) {
							               bottomResult[(i + 1)] -= 1;
							             }
						           }
					         }

				         this.bottomLevelInfo.setDividerPos(bestResult);
				       }

			       return true;
			     }
			// 计算拉杆长度
		     private void calPullBarLength()
		     {    // 不是实木的情况
			       if (!m_OrderInfo.getIsBoard())
				       {
				         int dividerNum = 0;
				         if (!CurtainChecker.isEmpty(m_OrderInfo.GetDividerNum()))
					         {
					           dividerNum = Integer.parseInt(m_OrderInfo.GetDividerNum());
					         }
				         if (dividerNum == -1)
					         {
					           dividerNum = 0;
					         }
				         float[] result = new float[4];
				         int[] pulBarlNumPerLevel = new int[4];
				         int vaneType = m_OrderInfo.GetVaneType();
				         float vaneWidth = Float.parseFloat(Constants.VANETYPE[vaneType]);
				         int vaneNum = this.topLevelInfo.getVaneNumPerPane();
				         int[] dividerPos = this.topLevelInfo.getDividerPos();

				         int pullBarType = m_OrderInfo.GetPullBarType();

				         float muchWidth = 0.0F; // 多余宽度？

				         float overlapSize = 0.0F;
				         // 叶片类型不一样 overlapSize 也不一样
				         switch (vaneType) {
					         case 0:
						           overlapSize = 12.7F;
						           break;
					         case 1:
						           overlapSize = 12.7F;
						           break;
					         case 2:
						           overlapSize = 12.7F;
						           break;
					         case 3:
						           overlapSize = 8.0F;
						           muchWidth = 2.3F;
						           break;
					         case 4:
						           overlapSize = 6.0F;
						         }

						  // 不同拉杆类型对应不同的拉杆长度
				         if (pullBarType == 1)
					         {
					           int totalVaneNumDownLastDivider = 0;
					           if (dividerNum == 0)
						           {
						           	// 拉杆长度 = （合页宽度 - overlapSize） * （每扇窗的合页数量 - 1） + 9.525F - muchWidth
						             float pullBarLen = (vaneWidth - overlapSize) * (this.topLevelInfo.getVaneNumPerPane() - 1) + 9.525F - muchWidth;

						             if (pullBarLen >= 2300.0F)
							             {
							               pullBarLen /= 2.0F;
							               pulBarlNumPerLevel[0] = 2;
							             }
						             else
							             {
							               pulBarlNumPerLevel[0] = 1;
							             }
						             result = new float[] { pullBarLen };
						           }
					           else
						           {
						             int i = 0;
						             for (i = 0; i < dividerNum; i++)
							             {
							               int downVaneNum = dividerPos[i];
							               result[i] = ((vaneWidth - overlapSize) * (downVaneNum - 1) + 9.525F - muchWidth);

							               if (result[i] >= 2300.0F)
								               {
								                 result[i] /= 2.0F;
								                 pulBarlNumPerLevel[i] = 2;
								               }
							               else
								               {
								                 pulBarlNumPerLevel[i] = 1;
								               }

							               totalVaneNumDownLastDivider += dividerPos[i];
							             }

						             int vaneNumUpLastDivider = vaneNum - totalVaneNumDownLastDivider;
						             result[i] = ((vaneWidth - overlapSize) * (vaneNumUpLastDivider - 1) + 9.525F - muchWidth);
						             if (result[i] >= 2300.0F)
							             {
							               result[i] /= 2.0F;
							               pulBarlNumPerLevel[i] = 2;
							             }
						             else
							             {
							               pulBarlNumPerLevel[i] = 1;
							             }

						           }

					         }
				         else if (dividerNum == 0)
					         {
					           float pullBarLen = (vaneWidth - overlapSize) * (this.topLevelInfo.getVaneNumPerPane() - 1) + 31.75F - muchWidth;
					           pulBarlNumPerLevel[0] = 1;
					           result = new float[] { pullBarLen };
					         }
				         else
					         {
					           int totalVaneNumDownLastDivider = 0;
					           int i = 0;
					           for (i = 0; i < dividerNum; i++) {
						             int downVaneNum = dividerPos[i];
						             result[i] = ((vaneWidth - overlapSize) * (downVaneNum - 1) + 31.75F - muchWidth);
						             pulBarlNumPerLevel[i] = 1;

						             totalVaneNumDownLastDivider += dividerPos[i];
						           }

					           int vaneNumUpLastDivider = vaneNum - totalVaneNumDownLastDivider;
					           result[i] = ((vaneWidth - overlapSize) * (vaneNumUpLastDivider - 1) + 31.75F - muchWidth);
					           pulBarlNumPerLevel[i] = 1;
					         }

				         this.topLevelInfo.setPullBarLength(result);
				         this.topLevelInfo.setPullBarNumPerLevel(pulBarlNumPerLevel);
				       }

			       if ((m_OrderInfo.GetLevel().trim().equals("2")) && (!m_OrderInfo.getBottomIsBoard()))
				       {
				         int dividerNum = 0;
				         if (!CurtainChecker.isEmpty(m_OrderInfo.getBottomDividerNum()))
					         {
					           dividerNum = Integer.parseInt(m_OrderInfo.getBottomDividerNum());
					         }
				         if (dividerNum == -1)
					         {
					           dividerNum = 0;
					         }
				         String vaneTypeStr = m_OrderInfo.getBottomVaneType();
				         float overlapSize = 0.0F;

				         float muchWidth = 0.0F;

				         if ((vaneTypeStr.trim().equals(Constants.VANETYPE[0])) || (vaneTypeStr.trim().equals(Constants.VANETYPE[1])) || (vaneTypeStr.trim().equals(Constants.VANETYPE[2])))
					         {
					           overlapSize = 12.7F;
					         }
				         else if (vaneTypeStr.trim().equals(Constants.VANETYPE[3]))
					         {
					           muchWidth = 2.3F;
					           overlapSize = 8.0F;
					         }
				         else if (vaneTypeStr.trim().equals(Constants.VANETYPE[4]))
					         {
					           overlapSize = 6.0F;
					         }
				         float[] bottomResult = new float[4];
				         int[] pulBarlNumPerLevel = new int[4];
				         int[] bottomDividerPos = this.bottomLevelInfo.getDividerPos();
				         float bottomVaneWidth = Float.parseFloat(vaneTypeStr);
				         int bottomVaneNum = this.bottomLevelInfo.getVaneNumPerPane();
				         int pullBarType = m_OrderInfo.GetPullBarType();
				         float vaneWidth = 0.0F;
				         if (!CurtainChecker.isEmpty(vaneTypeStr))
					         {
					           vaneWidth = Float.parseFloat(vaneTypeStr.trim());
					         }
				         int[] dividerPos = this.bottomLevelInfo.getDividerPos();
				         int vaneNum = this.bottomLevelInfo.getVaneNumPerPane();

				         if (pullBarType == 1)
					         {
					           if (dividerNum == 0)
						           {
						             float pullBarLen = (vaneWidth - overlapSize) * (this.bottomLevelInfo.getVaneNumPerPane() - 1) + 9.525F - muchWidth;

						             if (pullBarLen >= 2300.0F)
							             {
							               pullBarLen /= 2.0F;
							               pulBarlNumPerLevel[0] = 2;
							             }
						             else
							             {
							               pulBarlNumPerLevel[0] = 1;
							             }
						             bottomResult = new float[] { pullBarLen };
						           }
					           else
						           {
						             int totalVaneNumDownLastDivider = 0;
						             int i = 0;
						             for (i = 0; i < dividerNum; i++) {
							               int downVaneNum = bottomDividerPos[i];
							               bottomResult[i] = ((bottomVaneWidth - overlapSize) * (downVaneNum - 1) + 9.525F - muchWidth);

							               if (bottomResult[i] >= 2300.0F)
								               {
								                 bottomResult[i] /= 2.0F;
								                 pulBarlNumPerLevel[i] = 2;
								               }
							               else
								               {
								                 pulBarlNumPerLevel[i] = 1;
								               }

							               totalVaneNumDownLastDivider += bottomDividerPos[i];
							             }

						             int vaneNumUpLastDivider = bottomVaneNum - totalVaneNumDownLastDivider;
						             bottomResult[i] = ((vaneWidth - overlapSize) * (vaneNumUpLastDivider - 1) + 9.525F - muchWidth);

						             if (bottomResult[i] >= 2300.0F)
							             {
							               bottomResult[i] /= 2.0F;
							               pulBarlNumPerLevel[i] = 2;
							             }
						             else
							             {
							               pulBarlNumPerLevel[i] = 1;
							             }

						             pulBarlNumPerLevel[i] = 1;
						           }
					         }
				         else
					         {
					           if (dividerNum == 0)
						           {
						             float pullBarLen = (vaneWidth - overlapSize) * (this.bottomLevelInfo.getVaneNumPerPane() - 1) + 31.75F - muchWidth;
						             pulBarlNumPerLevel[0] = 1;
						             bottomResult = new float[] { pullBarLen };
						           }

					           int totalVaneNumDownLastDivider = 0;
					           int i = 0;
					           for (i = 0; i < dividerNum; i++) {
						             int downVaneNum = dividerPos[i];
						             bottomResult[i] = ((vaneWidth - overlapSize) * (downVaneNum - 1) + 31.75F - muchWidth);

						             totalVaneNumDownLastDivider += dividerPos[i];
						             pulBarlNumPerLevel[i] = 1;
						           }

					           int vaneNumUpLastDivider = vaneNum - totalVaneNumDownLastDivider;
					           bottomResult[i] = ((vaneWidth - overlapSize) * (vaneNumUpLastDivider - 1) + 31.75F - muchWidth);

					           pulBarlNumPerLevel[i] = 1;
					         }
				         this.bottomLevelInfo.setPullBarLength(bottomResult);
				         this.bottomLevelInfo.setPullBarNumPerLevel(pulBarlNumPerLevel);
				       }
			     }

		     private void calVaneBoltNumPerPane()
		     {
			       int vaneNum = 0;
			       if (m_OrderInfo.getIsBoard())
				       {
				         vaneNum = this.topLevelInfo.getVaneNumPerPane();
				       }
			       int vaneBoltNum = vaneNum * 2;
			       this.topLevelInfo.setVaneBoltNumPerPane(vaneBoltNum);

			       if (CurtainChecker.isEmpty(m_OrderInfo.GetLevel()))
				       {
				         int bottomVaneNum = 0;
				         if (!m_OrderInfo.getBottomIsBoard())
					         {
					           bottomVaneNum = this.bottomLevelInfo.getVaneNumPerPane();
					         }
				         int bottomVaneBoltNum = bottomVaneNum * 2;
				         this.bottomLevelInfo.setVaneBoltNumPerPane(bottomVaneBoltNum);
				       }
			     }

		     private void calTenonNumPerPane()
		     {
			       int E = 0;
			       float downBeamWidth = this.topLevelInfo.getDownBeamWidth();
			       if (downBeamWidth < 127.0F)
				       {
				         E = 4;
				       }
			       else
				       {
				         E = 6;
				       }

			       int F = 4;
			       int dividerNum = 0;
			       if (!CurtainChecker.isEmpty(m_OrderInfo.GetDividerNum())) // 分隔梁数量
				       {
				         dividerNum = Integer.parseInt(m_OrderInfo.GetDividerNum());
				       }
			       int result = E * 2 + F * dividerNum;
			       this.topLevelInfo.setTenonNumPerPane(result); // 每个窗格 榫 数量

			       if (m_OrderInfo.GetLevel().trim().equals("2"))
				       {
				         downBeamWidth = this.bottomLevelInfo.getDownBeamWidth();
				         if (downBeamWidth < 127.0F)
					         {
					           E = 4;
					         }
				         else
					         {
					           E = 6;
					         }

				         F = 4;
				         dividerNum = 0;
				         if (!CurtainChecker.isEmpty(m_OrderInfo.getBottomDividerNum()))
					         {
					           dividerNum = Integer.parseInt(m_OrderInfo.getBottomDividerNum());
					         }
				         result = E * 2 + F * dividerNum;
				         this.bottomLevelInfo.setTenonNumPerPane(result);
				       }
			     }

		     private void calMagnetSlice()
		     {
			       int totalNum = m_OrderInfo.getMagnetSliceNum();
			       winCalResult.setTotalMagnetSliceNum(totalNum);
			     }
		   }
	 }

/* Location:           C:\Users\Administrator\Desktop\奥特百叶窗\Shutter DesignerV3.1\CurtainDesign.jar
 * Qualified Name:     CurtainDesign.ResultInfoRectSimple
 * JD-Core Version:    0.6.0
 */